public void InvariantTest4() { Puzzle puzzle = new Puzzle(3, 3, new int[,] { { 8, 7, 6 }, { 5, 4, 3 }, { 2, 1, 0 }}); bool result = puzzle.LowerRowInvariant(2, 2); Assert.AreEqual(true, result, "Test #18 invariant test"); string move = puzzle.SolveInteriorTile(2, 2); Assert.AreEqual(move, "uulldrruldrulddruld", "Test #20 solve_interior test"); move = puzzle.SolveInteriorTile(2, 1); Assert.AreEqual(move, "uulddruld", "Test #22 solve_interior test"); }
public void InvariantTest3() { Puzzle puzzle = new Puzzle(4, 4, new int[,] { { 3,2,10,7 }, { 8,5,4,1 }, { 9,6,0,11 }, { 12,13,14,15 } }); bool result = puzzle.LowerRowInvariant(2, 2); Assert.AreEqual(true, result, "Test #9 invariant test"); string move = puzzle.SolveInteriorTile(2, 2); Assert.AreEqual(move, "uulddruld", "Test #11 solve_interior test"); }
public void InvariantTest1() { Puzzle puzzle = new Puzzle(4, 4, new int[,] { { 4, 2, 3, 7 }, { 8, 5, 6, 1 }, { 9, 10, 0, 11 }, { 12, 13, 14, 15 } }); bool result = puzzle.LowerRowInvariant(2, 2) ; Assert.AreEqual(true, result, "Test #3 invariant test"); string move = puzzle.SolveInteriorTile(2, 2); result = puzzle.LowerRowInvariant(2, 1); Assert.AreEqual(true, result, "Test #4 invariant test"); Assert.AreEqual(move, "l", "Test #5 solve_interior test"); }
public void SolveInterior15() { Puzzle puzzle = new Puzzle(4, 4, new int[,] { { 4, 2, 5, 6 }, { 12, 7, 8, 3 }, { 9, 14, 15, 0 }, { 13, 10, 11, 1 } }); string move = puzzle.SolveInteriorTile(3, 3); Assert.AreEqual(move, "duldruld", "Test #485 " + move); move = puzzle.SolveInteriorTile(3, 2); Assert.AreEqual(move, "uldruld", "Test #486 " + move); move = puzzle.SolveInteriorTile(3, 1); Assert.AreEqual(move, "l", "Test #487 " + move); move = puzzle.SolveCol0Tile(3); Assert.AreEqual(move, "uurdlruldrdlurdluurddlurrrr", "Test #488 " + move); move = puzzle.SolveInteriorTile(2, 3); Assert.AreEqual(move, "l", "Test #489"); move = puzzle.SolveInteriorTile(2, 2); Assert.AreEqual(move, "l", "Test #490"); move = puzzle.SolveInteriorTile(2, 1); Assert.AreEqual(move, "uld", "Test #491"); move = puzzle.SolveCol0Tile(2); Assert.AreEqual(move, "urrulldruldrdlurdluurddlurrr", "Test #492"); move = puzzle.SolveRow1Tile(3); Assert.AreEqual(move, "ullldrruldrruldru", "Test #493"); move = puzzle.SolveRow0Tile(3); Assert.AreEqual(move, "lduldruldurdlurrdluldrruld", "Test #494"); move = puzzle.SolveRow1Tile(3); Assert.AreEqual(move, "lur", "Test #495"); move = puzzle.SolveRow0Tile(3); Assert.AreEqual(move, "ld", "Test #496"); move = puzzle.Solve2x2(); Assert.AreEqual(move, "lu", "Test #497"); }