Maze Generator

http://ea115.posterous.com/mazegen

Generates a random maze using depth-first search. Red cell is the current cell, blue is the top of the stack: where it’ll jump to if it gets to a cell with no unvisited neighbors.

This code actually comes from another project I was working on to make a tilt labyrinth type of game. Still messing with it, need to get the collision detection working better (any updates on the physics lib btw?) I pulled out this code and used coroutines to make it so the maze generation could be watched. The slider will slow down the speed. Also in the setup method you can change the size variable to make bigger or smaller mazes.

That is awesome. I love watching it work. I had no idea you could generate mazes like this.

Maze Generator

Wow, it is like watching systematic termites. Tres cool.

Heh, neat! I wrote a maze generator using the same method on the Atari 400 in BASIC back in the dinosaur age, but you couldn’t see the process at work.

By “tilt labyrinth game” do you mean you’d have to navigate the maze by tilting the iPad? Do it! It sounds like fun, and this is a great start.