An algorithm for simulating a robot's movement within a room. The robot moves randomly 30% of the time; for the remaining 70%, it checks how many squares are clear in a given direction and moves one square at a time in that direction. In any case, the robot must never choose a direction and then immediately return to its previous position. Once positioned, the robot moves in search of the exit; the program terminates once the exit is found.