Can this program be made any shorter? http://www.dodaj.rs/f/1K/vW/2gLz63rl/blockly.png
takes awhile... hard to tell whats "shorter" while !wall(AHEAD): move forward turn left while wall(AHEAD): turn right
while true:
turn left
while wall(AHEAD):
turn right
move forward
However, while this algorithm happens to work on this maze, it will not work against other mazes (if you care).Imagine a 5x5 square race track, with spokes coming from the outside of the wheel to the center, where there was a flag. Your algorithm (and my modified one) would just spin clockwise around the track without ever realizing it should take a right towards the center.