A Small Maze

A simple maze generator based on the Aldous-Broder algorithm. That makes it sound more fancy than it is. basically, a perfect, bias-free maze is generated by a random walker, represented by the blue square. A direction is randomly chosen and, if the walker in move that way, it does.

Every time the walker walks into unvisited space, that space is connected to the space before it. You're left with a maze where every spot is connected and there are no loops. The drawback: this is an O(infinity) algorithm that could take until the heat death of the universe to make a maze.

This is the first in a series of maze explorations I plan on doing. The code for this one is pretty rough, but I've got some ideas on how to improve it next time.