コード例 #1
0
ファイル: Program.cs プロジェクト: fzysk/AoC2020
        static void Main(string[] args)
        {
            List <Direction> directions = File.ReadAllLines("input.txt").Select(line => Direction.CreateDirection(line)).ToList();

            Direction direction = new East();

            foreach (Direction nextDirection in directions)
            {
                direction = direction.Apply(nextDirection);
            }

            Console.WriteLine(direction.GetManhattanDistanceFromStartingPoint());
        }