Two grids are shown below. For each grid, the code below is intended to move the robot to the gray square. The program uses the procedure Arrived(), which evaluates to true if the robot is in the gray square, and false otherwise.
REPEAT UNTIL (Arrived())
{
IF (CAN_MOVE(right))
{
ROTATE_RIGHT()
}
ELSE
{
IF (CAN_MOVE(left))
{
ROTATE_LEFT()
}
}
IF (CAN_MOVE(forward))
{
MOVE_FORWARD()
}
}
Repair the code so that the robot will make it to the gray square no matter which of the two grids it choses.
