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