static void Test1b() { Board board; var piecesD = TestLoader.LoadTest("Test2.txt", out board); foreach (var pieceD in piecesD) { Logger.Info($"{pieceD.Value}"); } board.UpdateBoard(piecesD['A'], 1, 0, Operation.Put, true); Logger.Info(board); board.UpdateBoard(piecesD['A'], 2, 0, Operation.Put, true); Logger.Info(board); board.UpdateBoard(piecesD['A'], 2, 0, Operation.Remove, true); Logger.Info(board); board.UpdateBoard(piecesD['A'], 1, 0, Operation.Remove, true); Logger.Info(board); /*foreach (var piece in pieces) * Logger.Info(piece.Value.ToStringDebug()); */ // board.TrySolve(pieces); }
static void Test1() { Board board; var pieces = TestLoader.LoadTest("Test1.txt", out board); board.UpdateBoard(pieces['A'], 1, 0, Operation.Put, true); Logger.Info(board); board.UpdateBoard(pieces['B'], 2, 0, Operation.Put, true); Logger.Info(board); Logger.Info(board.SearchPositions(pieces['A']).ToString2()); board.UpdateBoard(pieces['A'], 1, 0, Operation.Remove, true); Logger.Info(board); var positions = board.SearchPositions(pieces['C']); board.UpdateBoard(pieces['C'], positions[0].Row, positions[0].Column, Operation.Put, true); Logger.Info(board); // board.TrySolve(pieces); var piecesD = board.LoadPiecesFromBoard(); foreach (var pieceD in piecesD) { Logger.Info($"{pieceD.Value} occurence of {pieceD.Key}"); } }
static void Test6(string name) { Board board; var pieces = TestLoader.LoadTest($"generated_{name}.txt", out board); Logger.Info(board); foreach (var piece in pieces) { Logger.Info(piece.Value.ToString()); } }
static void Test2() { Board board; var pieces = TestLoader.LoadTest("Moyen205.txt", out board); Logger.Info(board); foreach (var piece in pieces) { Logger.Info(piece.Value.ToStringDebug()); } var orderPieces = pieces.Values.OrderByDescending(x => x.Complexity); foreach (var piece in orderPieces) { Logger.Info($"{piece.Names} => {piece.Complexity}"); } //board.UpdateBoard(pieces['A'], new Position(1, 0), Operation.Put, true); Logger.Info(board.ToStringDebug()); board.TrySolve(pieces, true); }