Example #1
0
        private static void ExecuteTurn(IRobot robot)
        {
            Exception e;
            do
            {
                try
                {
                    robot.ExecuteInstructions(Console.ReadLine());
                    e = null;
                } catch (Exception exception)
                {
                    Console.WriteLine(exception.Message);
                    e = exception;
                }

            } while (e != null);
            Console.WriteLine("{0} {1} {2}", robot.X, robot.Y, Enum.GetName(typeof(OrientationEnum), robot.Orientation).Substring(0,1));
        }
Example #2
0
        private static void ExecuteTurn(IRobot robot)
        {
            Exception e;

            do
            {
                try
                {
                    robot.ExecuteInstructions(Console.ReadLine());
                    e = null;
                } catch (Exception exception)
                {
                    Console.WriteLine(exception.Message);
                    e = exception;
                }
            } while (e != null);
            Console.WriteLine("{0} {1} {2}", robot.X, robot.Y, Enum.GetName(typeof(OrientationEnum), robot.Orientation).Substring(0, 1));
        }