This is something that’s been sitting on my hard drive for a very long time now, an AS3 implementation of the Depth First Search algorithm, used here to generate mazes. This was originally created as a personal project, but it also ended up being applicable to a class. On both counts, the final product turned out to be pretty cool.
In addition to generating mazes, it also allows you to spawn mice to mindlessly scamper through the maze. Although the same algorithm to generate the maze could be used to solve it, this would’ve been pretty boring to look at. The mice, when faced with a decision, simply randomly pick a direction to go. This simple solving algorithm also allows you to spawn a few hundred mice without any real speed loss, which makes it slightly more exciting to watch.
The only real problem with this implementation as it stands is that the mazes it makes aren’t very tough. The incorrect paths usually hit a dead end pretty quickly, making it a lot easier to backtrack and continue.
The download containing everything is attached below, released under a 2 clause BSD license.



