Robot Maze Challenge

Available commands are…

  • MOVE_FORWARD();
  • ROTATE_RIGHT();
  • MOVE_FORWARD();
  • CAN_MOVE(“direction”);

Choices for “direction” are…

  • “forward”
  • “backward”
  • “right”
  • “left”

Example Code…

if(CAN_MOVE(“right”)){
    ROTATE_RIGHT();
    MOVE_FORWARD();
}

Write one code that can guide the robot from the top left square to the bottom right square no matter which of the 6 situations the robot finds itself in.

You can test your code here. *