Stumbled upon this last night.
We get a lot of questions about how to generate mazes. This site has a very good algo on it.
I will provide code for this and attach it here later.
Here is the algo:
http://www.mazeworks.com/mazegen/mazetut/index.htm