Maze


Sometime around 1991 I saw a screen saver for the Macintosh that would generate a maze and then proceed to solve it as you watched. It was something similar to this.

Of course, this applet could solve the maze nearly instantly and display the correct path, but the point of this is to have something visually compelling. I think it’s kind of fun to watch.

The funny thing about writing this was that I found that generating a random maze turned out to be quite a bit more complicated than actually solving it. The solve algorithm is only a few lines of code and uses the programming technique of recursion.