Example #1
0
        static int SolvePart1(List <string> directions)
        {
            Ferry theFerry = new Ferry('E');

            foreach (string dir in directions)
            {
                theFerry.Move(dir);
                //Console.ReadKey();
            }

            return(theFerry.GetManhattanDistance());
        }
Example #2
0
        static int SolvePart2(List <string> directions)
        {
            Ferry theFerry = new Ferry('E');

            theFerry.SetEWWaypoint('E', 10);
            theFerry.SetNSWaypoint('N', 1);

            foreach (string dir in directions)
            {
                theFerry.MoveWaypoint(dir);
                //Console.ReadKey();
            }

            return(theFerry.GetManhattanDistance());
        }