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