I wrote an article about my journey writing this tool on https://fau.re/blog/20160206_rust_maze.html
maze -r plain -g100x100 --foreground #585858 --animation --algorithm prim prim.gifIt produces the following gif in 295 iterations:
maze -r plain -g100x100 --foreground #585858 --animation --algorithm kruskal kruskal.gifIt produces the following gif in 287 iterations:
maze -r plain -g100x100 --foreground #585858 --animation --algorithm backtracker backtracker.gifIt produces the following gif in only 169 iterations:
maze -g630x400 --foreground #ffffff --background #000000 plain.pngmaze -g 635x400 -r mosaic mosaic.pngmaze -g 637x399 --foreground #585858 -r invaders invaders.pngThe maze generator can be biased to create mazes with a certain orientation. Here is an example of a maze with a strong vertical bias:
maze -g 630x400 --foreground #585858 -b 0.65 vertical_bias.pngOr from a different starting point, in the center of the maze:
maze -g 630x400 --foreground #585858 -b 0.65 -o 0.5x0.5 bias_centered.pngThe maze generator can also shade the walls based on their distance from the starting point. In this example, the color goes from red to white based on the length of path from the center:
maze -g630x400 -o 0.5x0.5 --gradient length maze.pngA different can be achieved by shading based on the distance from the solution. It produces a lava river effect:
maze -g630x400 --foreground #d70000\ #585858 --gradient solution lava_river.pngThe impact of the Prim algorithm is clearly visible : it tends to produce mazes that go from top left to bottom right in a direct way.
With the Kruskal algorithm, the effect is more subtle:
maze -g630x400 --foreground #d70000\ #585858 --gradient solution --algorithm kruskal kruskal.pngWith the backtracker algorithm:
maze -g630x400 --foreground #d70000\ #585858 --gradient solution --algorithm backtracker backtracker.png








