cd ai4u-read-only/com.ai4u.util/trunk/src
javac com/ai4u/util/*.java com/ai4u/util/disjointSet/*.java com/ai4u/util/games/maze/Maze.java
java com.ai4u.util.games.maze.Maze
I like the output of this maze algo even more than the standard recursive backtracker, plus it's more efficient; from a few walkthroughs it seems to generate slightly more challenging mazes as well. (A solver line would help showing this and any bias.)
Also to make more fun (Maze.java):
final int rows, cols;
if (args.length == 2) {
rows = Integer.parseInt(args[0]); cols = Integer.parseInt(args[1]);
} else {
rows = cols = 30;
}
final Maze m = createRandomMaze(rows, cols);
...
.addGap(0, 13 * cols,
...
.addGap(0, 13 * rows,
Also to make more fun (Maze.java):