Ejemplo n.º 1
0
 def test_move_waypoint_right_from_up(self):
     ferry = part2.Ferry(0, 4)
     ferry.apply_instruction('R', 90)
     self.assertEqual(ferry.waypoint.x, 4)
     self.assertEqual(ferry.waypoint.y, 0)
     self.assertEqual(ferry.waypoint.angle, 0)
Ejemplo n.º 2
0
 def test_move_waypoint_right_from_up_left(self):
     ferry = part2.Ferry(-4, 1)
     ferry.apply_instruction('R', 90)
     self.assertEqual(ferry.waypoint.x, 1)
     self.assertEqual(ferry.waypoint.y, 4)
     self.assertEqual(round(ferry.waypoint.angle), 76)
Ejemplo n.º 3
0
 def test_move_waypoint_left_from_up_right(self):
     ferry = part2.Ferry(4, 1)
     ferry.apply_instruction('L', 180)
     self.assertEqual(ferry.waypoint.x, -4)
     self.assertEqual(ferry.waypoint.y, -1)
     self.assertEqual(round(ferry.waypoint.angle), 194)
Ejemplo n.º 4
0
 def test_move_waypoint_left_from_right(self):
     ferry = part2.Ferry(4, 0)
     ferry.apply_instruction('L', 180)
     self.assertEqual(ferry.waypoint.x, -4)
     self.assertEqual(ferry.waypoint.y, 0)
     self.assertEqual(ferry.waypoint.angle, 180)
Ejemplo n.º 5
0
 def test_move_waypoint_left_from_down(self):
     ferry = part2.Ferry(0, -4)
     ferry.apply_instruction('L', 90)
     self.assertEqual(ferry.waypoint.x, 4)
     self.assertEqual(ferry.waypoint.y, 0)
     self.assertEqual(ferry.waypoint.angle, 0)
Ejemplo n.º 6
0
 def test_move_waypoint_left_from_down_left(self):
     ferry = part2.Ferry(-1, -4)
     ferry.apply_instruction('L', 90)
     self.assertEqual(ferry.waypoint.x, 4)
     self.assertEqual(ferry.waypoint.y, -1)
     self.assertEqual(round(ferry.waypoint.angle), -14)
Ejemplo n.º 7
0
 def test_move_waypoint_left_from_left(self):
     ferry = part2.Ferry(-4, 0)
     ferry.apply_instruction('L', 90)
     self.assertEqual(ferry.waypoint.x, 0)
     self.assertEqual(ferry.waypoint.y, -4)
     self.assertEqual(ferry.waypoint.angle, 270)