Exemplo 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]]))
Exemplo 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]))
Exemplo 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]))
Exemplo 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]))
Exemplo 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]))
Exemplo 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]]))
Exemplo 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]))
Exemplo 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]))
Exemplo 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]))
Exemplo 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]))