Example #1
0
 def test_obst(self):
     """Diagonally move"""
     matr1 = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
     self.assertFalse(a.find_way((1, 1), (4, 4), a.make_border(matr1)))
Example #2
0
 def test_lazytest(self):
     """No moving"""
     matr1 = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
     self.assertFalse(a.find_way((0, 0), (0, 0), a.make_border(matr1)))
Example #3
0
 def test_hard_labirinth(self):
     """Hard way"""
     matr2 = [[0, 0, 1, 0, 0], [1, 0, 1, 0, 0], [0, 0, 1, 0, 0],
              [0, 1, 1, 0, 0], [0, 0, 0, 0, 0]]
     self.assertTrue(a.find_way((1, 1), (1, 4), a.make_border(matr2)))
Example #4
0
 def test_obstacles(self):
     """No way"""
     matr3 = [[0, 0, 1, 0], [0, 0, 1, 0], [1, 1, 1, 0], [0, 0, 0, 0]]
     self.assertFalse(a.find_way((0, 0), (3, 3), a.make_border(matr3)))
Example #5
0
 def test_no_obst(self):
     """Easy way"""
     matr1 = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
     self.assertTrue(a.find_way((1, 1), (4, 4), a.make_border(matr1)))