Beispiel #1
0
 def test_multiple_motions(self):
     bot = Robot(world=self.world)
     self.assertEqual(self.world, 
                      bot.move(self.world, 
                               [[1, 0], [0, 1], [-1, 0], [0, -1]]))
Beispiel #2
0
 def test_move_up_left(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 1]], 
                      bot.move(self.world, [-1, -1]))
Beispiel #3
0
 def test_move_down_right(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0],
                       [0, 1, 0, 0, 0],
                       [0, 0, 0, 0, 0]], 
                      bot.move(self.world, [1, 1]))
Beispiel #4
0
 def test_stand_still(self):
     bot = Robot(world=self.world)
     self.assertEqual([[1, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0]],
                      bot.move(self.world, [0, 0]))
Beispiel #5
0
 def test_move_up(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0],
                       [1, 0, 0, 0, 0]], 
                      bot.move(self.world, [-1, 0]))
Beispiel #6
0
 def test_multiple_motions(self):
     bot = Robot(world=self.world)
     self.assertEqual(
         self.world, bot.move(self.world,
                              [[1, 0], [0, 1], [-1, 0], [0, -1]]))
Beispiel #7
0
 def test_move_down_right(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0]],
                      bot.move(self.world, [1, 1]))
Beispiel #8
0
 def test_move_up_left(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 1]],
                      bot.move(self.world, [-1, -1]))
Beispiel #9
0
 def test_move_up(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [1, 0, 0, 0, 0]],
                      bot.move(self.world, [-1, 0]))
Beispiel #10
0
 def test_stand_still(self):
     bot = Robot(world=self.world)
     self.assertEqual([[1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]],
                      bot.move(self.world, [0, 0]))