This problem solved using the approach of "touching" the left wall at all times. There are a few pre-conditions that we guarantee the success of the exit of the robot from the maze:
- I assume the robot begins his walk from the first square at (6,0).
- After The robot enter the maze, the entrence becomes a wall.
- I assume for each maze, there is an exit.
If the maze follows the above pre conditions, I can guarantee that the robot will find the exit.