public static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Traveler app has been started!");

                var robotCommands = File.ReadAllText("input.txt");

                var endCoordinates = TravelParser.Run(robotCommands);

                foreach (var coordinate in endCoordinates)
                {
                    Console.WriteLine($"X={coordinate.x} Y={coordinate.y} D={coordinate.direction}");
                }

                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("--------------------------------------------------------------------------");
                Console.WriteLine(ex.Message);
                Console.WriteLine();
                Console.WriteLine();
            }
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            string text = File.ReadAllText(@"~\..\..\..\..\..\..\data\input.txt");

            Console.WriteLine(text);

            var result = TravelParser.Run(text);

            foreach (var item in result)
            {
                Console.WriteLine("X={0} Y={1} D={2}", item.x, item.y, item.direction);
            }
        }