Consider a robot that is placed in a room. The robot can: Move forward by one

Question:

Consider a robot that is placed in a room. The robot can:
• Move forward by one unit.
• Turn left or right.
• Sense what is in front of it: a wall, a window, or neither.

Write an algorithm that enables the robot, placed anywhere in the room, to count the number of windows. For example, in the room at right, the robot (marked as R) should find that it has two windows.

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

Step by Step Answer:

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