Exemple #1
0
        /// <summary>
        /// Rotates the rover based on the input received
        /// </summary>
        /// <param name="command">"L" or "R" taken from input</param>
        public void ProcessCommands()
        {
            foreach (char command in inputCommand)
            {
                switch (command)
                {
                case 'L':
                    dir.TurnLeft();
                    break;

                case 'R':
                    dir.TurnRight();
                    break;

                case 'M':
                    MoveRover();
                    RoverIsInBoundaries();
                    break;

                default:
                    Console.WriteLine("Wrong command given!");
                    break;
                }
            }
        }
 public void RotateRight()
 {
     Direction.TurnRight();
 }