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()); }