Exemplo n.º 1
0
        private static void SolvePartTwo(List <string> instructions)
        {
            Console.WriteLine("Part II");

            var ship = new WaypointFerry(new Position
            {
                X = 10,
                Y = 1
            }, Constants.East);

            var distance = new NavigationSystem(ship, instructions).CalculateManhattanDistance();

            Console.WriteLine($"ManhattanDistance: {distance}");
        }
        public void ShouldRotateWaypointClockwise()
        {
            // Arrange
            var ship = new WaypointFerry(new Position
            {
                X = 10,
                Y = 4
            }, 0);

            // Act
            ship.RotateRight(Constants.East);

            // Assert
            ship.Waypoint.X.Should().Be(4);
            ship.Waypoint.Y.Should().Be(-10);
        }