Ejemplo n.º 1
0
        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");
        }