Maze generators

This family of algorithms uses the following callback values:

DividedMaze

Based on a Recursive division method.

var w = 39, h = 25; var dm = new ROT.Map.DividedMaze(w, h); for (var i=0; i<4; i++) { var display = new ROT.Display({width:w, height:h, fontSize:6}); SHOW(display.getContainer()); dm.create(display.DEBUG); }

Icey's Maze

Cool mazes with a configurable regularity can be created using this algorithm, taken from a Rogue Basin wiki. Regularity is an integer value, specified as a third argument; 0 = most random.

var w = 39, h = 25; for (var i=0; i<4; i++) { var display = new ROT.Display({width:w, height:h, fontSize:6}); SHOW(display.getContainer()); var maze = new ROT.Map.IceyMaze(w, h, 4*i); maze.create(display.DEBUG); }

Eller's Perfect Maze

For a full explanation of this wonderful Eller's algorithm, please see http://homepages.cwi.nl/~tromp/maze.html. Not only it generates a Perfect maze (every two cells are connected by exactly one path), but it only requires 2*N memory to generate a maze of N*N size!

var w = 39, h = 25; var em = new ROT.Map.EllerMaze(w, h); for (var i=0; i<4; i++) { var display = new ROT.Display({width:w, height:h, fontSize:6}); SHOW(display.getContainer()); em.create(display.DEBUG); }