Write an algorithm that allows a robot to mow a rectangular lawn, provided it has been placed

Question:

Write an algorithm that allows a robot to mow a rectangular lawn, provided it has been placed in a corner, like this: 

The robot (marked as R) can:
• Move forward by one unit.
• Turn left or right.
• Sense the color of the ground one unit in front of it.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: