mirror of
https://github.com/farcasclaudiu/MartianRobots.git
synced 2026-06-28 17:01:10 +03:00
Add project files.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
namespace MartianRobotsSolver
|
||||
{
|
||||
public class RobotCommandRight : IRobotCommand
|
||||
{
|
||||
public string Command => "R";
|
||||
|
||||
public void Process(RobotInfo robotInfo)
|
||||
{
|
||||
var hIndex = RobotCommandConstants.HEADING.IndexOf(robotInfo.Head)+1;
|
||||
if(hIndex>RobotCommandConstants.HEADING.Length-1)
|
||||
hIndex = 0;
|
||||
robotInfo.Head = RobotCommandConstants.HEADING[hIndex].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user