Maze Generation: Weave mazes
@Robin, very nice, I love how it’s actually simpler to allow adjacent crossings. I’ll bet it could even be simpler: we probably don’t even need to check the connected status of east/west and north/south pairs during the crossing phase, since they can only be connected if the center cell is non-zero, and that’s already grounds for dismissal all by itself. @Baz, the problem is just what you said, you’ll wind up with disjoint trees. Think of it this way: if the maze is perfect (and all of these algorithms are guaranteed to make perfect mazes), then there will be exactly one path between any two pairs of cells in the maze. In other words, the maze can be considered a tree. Now, if you make an intersection into an over/under crossing, you are erasing the path between two cells, and since those two cells were previously connected, that must have been the only way they were conne...
Full article:
http://weblog.jamisbuck.org/2011/3/4/maze-generation-weav...