Beispiel #1
0
 def test_that_next_move_when_facing_right_with_wall_right_down_and_left_no_wall_up_is_up(self):
     maze = numpy.array([[1, 1, 0, 1, 1],
                         [1, 1, 0, 1, 1],
                         [1, 1, 1, 1, 1]])
     facing, row, col = solve_maze.next_move('R', 1, 2, maze)
     self.assertEqual('U', facing)
     self.assertEqual(0, row)
     self.assertEqual(2, col)
Beispiel #2
0
 def test_that_next_move_when_facing_down_with_wall_down_and_no_wall_left_is_left(self):
     maze = numpy.array([[1, 1, 1, 1, 1],
                         [1, 0, 0, 1, 1],
                         [1, 1, 1, 1, 1]])
     facing, row, col = solve_maze.next_move('D', 1, 2, maze)
     self.assertEqual('L', facing)
     self.assertEqual(1, row)
     self.assertEqual(1, col)
Beispiel #3
0
 def test_that_next_move_when_facing_right_without_wall_right_is_right(self):
     maze = numpy.array([[1, 1, 1, 1, 1],
                         [1, 1, 0, 0, 1],
                         [1, 1, 1, 1, 1]])
     facing, row, col = solve_maze.next_move('R', 1, 2, maze)
     self.assertEqual('R', facing)
     self.assertEqual(1, row)
     self.assertEqual(3, col)
Beispiel #4
0
 def test_that_next_move_when_facing_down_without_wall_down_is_down(self):
     maze = numpy.array([[1, 1, 1, 1, 1],
                         [1, 1, 0, 1, 1],
                         [1, 1, 0, 1, 1]])
     facing, row, col = solve_maze.next_move('D', 1, 2, maze)
     self.assertEqual('D', facing)
     self.assertEqual(2, row)
     self.assertEqual(2, col)