Get the latest tech news
Maze Generation: Recursive Division (2011)
All of the maze algorithms I’ve covered so far (recursive backtracking, Eller’s, Kruskal’s, and Prim’s) were implemented as “passage carvers”: they started with a solid grid and hollowed the passages out of it. Some algorithms can be implemented a different way (and indeed, some must be implemented this way): as “wall adders”, where the process begins with a large empty space, and adds walls until a maze results.
It’ll prevent really glaring biases in the finished product, and generally makes for more interesting mazes. My complete implementation is here, including some simple ASCII output routines (an ANSI terminal is required): 12 January 2011 — A novel method for generating fractal-like mazes is presented, with sample code and an animation — 6-minute read
Or read this on Hacker News