Honey Comb Maze
Help the bee through the maze using the <left>,<right> and <up> keys... if you're stuck, click 'show path' and a spider will lead the way...


(NOTE: this program uses large arrays... the bigger the maze - the more memory it will use)

 

Why...?
I set my students (hi guys...) an exercise involving creation of a maze game. We all generated mazes by hand and it set me thinking it would be nice to write a script that generated random mazes of any size.

How...?
I did a web search on Google.com looking for maze generation algorithms and the one I liked was described on this page...

http://www.pmms.cam.ac.uk/~gjm11/programs/maze/index.html

...the web page describes the use for a hexagonal maze but the algorithm works for any regular grid. I like the algorithm because you end up with a maze where every cell is connected to every other cell by only a single path. Great for generating game levels with enemies wandering the maze.

After that I added my own solving routine which is like a simple depth first sort. I made Flash draw the paths every time it reaches the end of a branch which makes a nice seeking effect. The path is drawn by a friendly spider once the maze is solved.

Try solving the maze yourself with the arrow keys first...

open fullscreen (ie only... ctrl-w closes)