Skip to content

Instantly share code, notes, and snippets.

@explorer14

explorer14/TurnLeft.cs Secret

Created Jun 22, 2020
Embed
What would you like to do?
public CurrentRoverPosition TurnLeft()
{
switch (NewHeading)
{
case Direction.North:
NewHeading = NewHeading + 9;
break;
case Direction.East:
NewHeading = NewHeading + 9;
break;
case Direction.West:
NewHeading = NewHeading - 4;
break;
case Direction.South:
NewHeading = NewHeading - 14;
break;
default:
break;
}
return new CurrentRoverPosition(
Id,
NewPositionX,
NewPositionY,
NewHeading);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.