Exemplo n.º 1
0
 def test_part1(self):
     input = ["F10", "N3", "F7", "R90", "F11"]
     ship = Ship()
     ship.print()
     ship.navigate(input)
     self.assertEqual(ship.x, 17)
     self.assertEqual(ship.y, -8)
     self.assertEqual(ship.compute_distance(), 25)
Exemplo n.º 2
0
 def test_part2(self):
     input = ["F10", "N3", "F7", "R90", "F11"]
     ship = Ship()
     ship.turnon_waypoint(10, 1)
     ship.print()
     ship.navigate(input)
     self.assertEqual(ship.x, 214)
     self.assertEqual(ship.y, -72)
     self.assertEqual(ship.compute_distance(), 286)