示例#1
0
 def test_10_move_vertical_S(self):
     test_bot = RobotController(
         fix_input_grid("5 5"),
         fix_input_start_pos("3 3 S"),
         fix_input_moves("RFLFFLRF"),
     )
     test_bot.vertical_move()
     self.assertEqual(test_bot.current_row, 4)
示例#2
0
 def test_8_move_horizontal_W(self):
     test_bot = RobotController(
         fix_input_grid("5 5"),
         fix_input_start_pos("2 0 W"),
         fix_input_moves("RFLFFLRF"),
     )
     test_bot.vertical_move()
     self.assertEqual(test_bot.current_column, 2)
示例#3
0
 def test_7_move_horizontal_E(self):
     test_bot = RobotController(
         fix_input_grid("5 5"),
         fix_input_start_pos("0 0 E"),
         fix_input_moves("RFLFFLRF"),
     )
     test_bot.horizontal_move()
     self.assertEqual(test_bot.current_column, 1)
示例#4
0
 def test_5_turn_left(self):
     test_bot = RobotController(
         fix_input_grid("5 5"),
         fix_input_start_pos("0 0 E"),
         fix_input_moves("RFLFFLRF"),
     )
     test_bot.turn("L")
     self.assertEqual(test_bot.direction, "N")
示例#5
0
 def test_14_output(self):
     test_bot = RobotController(
         fix_input_grid("5 5"),
         fix_input_start_pos("0 0 E"),
         fix_input_moves("RFLFFLRF"),
     )
     test_bot.move()
     test_bot.position()
     self.assertEqual(test_bot.current_position, "3 1 E")
示例#6
0
 def test_3_test_robot_init(self):
     test_bot = RobotController(
         fix_input_grid("5 5"),
         fix_input_start_pos("0 0 E"),
         fix_input_moves("RFLFFLRF"),
     )
     self.assertEqual(test_bot.current_row, 0)
     self.assertEqual(test_bot.current_column, 0)
     self.assertEqual(test_bot.direction, "E")
     self.assertEqual(test_bot.commands[-1], "F")
示例#7
0
 def test_3_test_input_grid(self):
     test_grid = fix_input_grid("5 5")
     self.assertEqual(type(test_grid[0]), int)