public void Returns_Rover_Final_Coordinate_Correctly_When_Rover_Initial_Alignment_Is_West_And_Move_Command_Is_B_B_L_B_B() { //Arrange int roverInitialXCoordinate = 0; int roverInitialYCoordinate = 0; char roverMoveCommand1 = 'B'; char roverMoveCommand2 = 'B'; char roverMoveCommand3 = 'L'; char roverMoveCommand4 = 'B'; char roverMoveCommand5 = 'B'; //Act RoverFinalPositionServices myRoverPosition = new RoverFinalPositionServices(); RoverAlignmentService myRoverAlignment = new RoverAlignmentService(); int roverXCoordinateAfterMoveCommand1 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsWestAndMoveCommandIsBackward(roverInitialXCoordinate); int roverXCoordinateAfterMoveCommand2 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsWestAndMoveCommandIsBackward(roverXCoordinateAfterMoveCommand1); string roverAlignmentAfterMoveCommand3 = myRoverAlignment.GetChangedRoverAlignmentWhenInitialAlignmentIsWestAndMotionInstructionIsL(roverMoveCommand3); int roverYCoordinateAfterMoveCommand4 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsSouthAndMoveCommandIsBackward(roverInitialYCoordinate); int roverYCoordinateAfterMoveCommand5 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsSouthAndMoveCommandIsBackward(roverYCoordinateAfterMoveCommand4); string actualRoverFinalCoordinate = roverXCoordinateAfterMoveCommand2.ToString() + roverYCoordinateAfterMoveCommand5.ToString() + roverAlignmentAfterMoveCommand3; //Assert Assert.AreEqual(actualRoverFinalCoordinate, "22S"); }
public void Returns_Rover_Final_Coordinate_Correctly_When_Rover_Initial_Alignment_Is_West_And_Move_Command_Is_F_F_R_F_F() { //Arrange int roverInitialXCoordinate = 0; int roverInitialYCoordinate = 0; //char[] roverMoveCommand = { 'F', 'F', 'R', 'F', 'F' }; char roverMoveCommand1 = 'F'; char roverMoveCommand2 = 'F'; char roverMoveCommand3 = 'R'; char roverMoveCommand4 = 'F'; char roverMoveCommand5 = 'F'; //Act RoverFinalPositionServices myRoverPosition = new RoverFinalPositionServices(); RoverAlignmentService myRoverAlignment = new RoverAlignmentService(); int roverXCoordinateAfterMoveCommand1 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsWestAndMoveCommandIsForward(roverInitialXCoordinate); int roverXCoordinateAfterMoveCommand2 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsWestAndMoveCommandIsForward(roverXCoordinateAfterMoveCommand1); string roverAlignmentAfterMoveCommand3 = myRoverAlignment.GetChangedRoverAlignmentWhenInitialAlignmentIsWestAndMotionInstructionIsR(roverMoveCommand3); int roverYCoordinateAfterMoveCommand4 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsNorthAndMoveCommandIsForward(roverInitialYCoordinate); int roverYCoordinateAfterMoveCommand5 = myRoverPosition.GetRoversFinalCoordinateWhenItsIntialAlignmentIsNorthAndMoveCommandIsForward(roverYCoordinateAfterMoveCommand4); string actualRoverFinalCoordinate = roverXCoordinateAfterMoveCommand2.ToString() + roverYCoordinateAfterMoveCommand5.ToString() + roverAlignmentAfterMoveCommand3; //Assert Assert.AreEqual(actualRoverFinalCoordinate, "-22N"); }
static void Main(string[] args) { RoverForwardMovementServices myRoverForwardMovement = new RoverForwardMovementServices(); RoverBackwardMovementServices myRoverBackwardMovement = new RoverBackwardMovementServices(); RoverFinalPositionServices myRoverPosition = new RoverFinalPositionServices(); RoverAlignmentService myRoverAlignment = new RoverAlignmentService(); Console.Beep(); Console.WriteLine("=========Welcome to Nasa Rover Mission========"); Console.WriteLine("Please provide rover x-coordinate :"); roverXCoordinate = Convert.ToInt32(Console.ReadLine()); Console.Beep(); Console.WriteLine("Please provide rover y-coordinate :"); roverYCoordinate = Convert.ToInt32(Console.ReadLine()); Console.Beep(); Console.WriteLine("Please provide rover alignment :"); roverAlignment = Console.ReadLine(); Console.Beep(); Console.WriteLine("Now please provide the rover move command below"); Console.WriteLine("Please provide first move command"); myRoverFistMoveCommand = Convert.ToChar(Console.ReadLine()); Console.Beep(); Console.WriteLine("Please provide second move command"); myRoverSecondMoveCommand = Convert.ToChar(Console.ReadLine()); Console.Beep(); //Console.WriteLine("Please provide third move command"); //char myRoverThirdMoveCommand = Convert.ToChar(Console.ReadLine()); //Console.Beep(); if (roverAlignment == "N" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'F') { roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'R') { roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'F') { roverAlignment = "E"; roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'R') { roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'F') { roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'R') { roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'F') { roverAlignment = "S"; roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'R') { roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'F') { roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'R') { roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'F') { roverAlignment = "W"; roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'R') { roverAlignment = "N"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'F') { roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'R') { roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverAlignment = "N"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'F') { roverAlignment = "N"; roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'R') { roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'B') { roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'R') { roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'B') { roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'L') { roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'B') { roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'R') { roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'B') { roverAlignment = "S"; roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'L') { roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'B') { roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'R') { roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'B') { roverAlignment = "W"; roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'L') { //roverAlignment = myRoverAlignment.GetChangedRoverAlignmentWhenInitialAlignmentIsSouthAndMotionInstructionIsL(myRoverFistMoveCommand); //roverAlignment = myRoverAlignment.GetChangedRoverAlignmentWhenInitialAlignmentIsEastAndMotionInstructionIsL(myRoverSecondMoveCommand); roverAlignment = "N"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'L') { roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'L') { roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'F') { roverAlignment = "W"; roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'L') { roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'B') { roverAlignment = "W"; roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'L') { roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverAlignment = "N"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'F') { roverAlignment = "N"; roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'L') { roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverAlignment = "N"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'B') { roverAlignment = "N"; roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsNorth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'L') { roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'F') { roverAlignment = "E"; roverXCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'L') { roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'B') { roverAlignment = "E"; roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsEast(roverXCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'F' && myRoverSecondMoveCommand == 'L') { roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'F') { roverAlignment = "S"; roverYCoordinate = myRoverForwardMovement.GetRoverForwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'B' && myRoverSecondMoveCommand == 'L') { roverXCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInXCoordinateWhenAlignmentIsWest(roverXCoordinate); roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'B') { roverAlignment = "S"; roverYCoordinate = myRoverBackwardMovement.GetRoverBackwardMovementInYCoordinateWhenAlignmentIsSouth(roverYCoordinate); roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'R') { roverAlignment = "N"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'R') { roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'R') { roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'L' && myRoverSecondMoveCommand == 'R') { roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "N" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'L') { roverAlignment = "N"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "E" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'L') { roverAlignment = "E"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "S" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'L') { roverAlignment = "S"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } if (roverAlignment == "W" && myRoverFistMoveCommand == 'R' && myRoverSecondMoveCommand == 'L') { roverAlignment = "W"; roverFinalPosition = roverXCoordinate.ToString() + roverYCoordinate.ToString() + roverAlignment; Console.WriteLine("Your rover final position is :" + roverFinalPosition); } Console.ReadLine(); }