Esempio n. 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]]))
Esempio n. 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]))
Esempio n. 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]))
Esempio n. 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]))
Esempio n. 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]))
Esempio n. 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]]))
Esempio n. 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]))
Esempio n. 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]))
Esempio n. 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]))
Esempio n. 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]))