RobotInGrid - recursive implementation