John Baylor experiments

Exploring Javascript Thru Mazes

Inspired by Jack Danger Canty’s exhortation to rewrite his depth-first maze in another language, I chose pure javascript. JQuery provides all sorts of goodness, as does Backbone and Ember, but I wanted to practice using the browser’s assembly language - javascript - to implement my maze. My implementation can be found here - just use ‘view source’ to see the entire implementation.

The only thing I added over his implementation was the delayed redraw of each cell, allowing us to see the maze being developed. I also, inadvertently, added a bass-ackwards grid that needs to be accessed as Y,X instead of the usual X,Y (oops).

Try it yourself in yet another language - its kinda fun.

Postscript 2/22/2012: @lantius modified my code to use Kruskal’s algorithm to generate very different mazes.

Blog format shamelessly lifted from Mojombo, creator of Jekyll