Maze Generator
mazegenerator.net
mazegenerator.net
What I found, though, was that you can construct mazes additively, while ensuring a single unique solution, by looking at the dual of the maze. If you start by drawing a shape with an entrance and an exit, you can start at any wall (including the borders, and just start drawing lines out that do not intersect previous lines. Basically you get a forest-like structure.
The neat thing is that this method can generate all mazes, and you can look at any generated maze, and if you just look at the dual (the tree-like graph of the walls) it's surprisingly easy to see the solution almost immediately. Hard to unsee once you get into the mindset of looking for it.
Like the linked application, it supports triangular, rectangular and hexagonal grids, and different generation algorithms, which can be combined for various areas of the final maze. It also supports background and mask images to colourise rooms and provide a shape for the maze, as well as a small selection of effects to apply. The output format is either SVG or PNG.
And for that extra HN cred, it's written in Rust (which you are free to ignore if you're not into RIIR, but this is in fact a rewrite of an earlier Python project of mine)!
I guess today's lesson is: do promote your personal project even when it's semi-arsed, because people on the Internet are mostly kind and will help you improve your documentation!
--method <METHOD> The initialisation method to use
In the mean time, have a look here[1] for the possible values.
[1]: https://github.com/moses-palmer/labyru/blob/7b92be3ae279a9ff...
use clap::{Parser, ValueEnum};
#[derive(ValueEnum, Debug, Clone)]
pub enum Foo {
Bar,
Baz,
}
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
pub struct Args {
/// description
#[arg(short = 'f', long = "foo", value_enum, default_value = "bar")]
foo: Foo,
}
The output of `--help` will look like: -f, --foo <FOO> description [default: bar] [possible values: bar, baz]
This is with clap >= 4.4 with the derive feature.(download and open with a browser/SVG viewer)
The invocation to generate that was:
./maze-maker --width=50 --height=50 --method braid,branching,winding out.svgFor anyone who can't render SVG in their head :)
There are already several online maze generator whose output is free for commercial use. What's so special about this one?
That said, how are people using this to generate any income at all? Printing out and selling mazes? How big can that market be?
[0] http://weblog.jamisbuck.org/archives.html (the maze posts date from early 2011)
I used what I learned to add a maze generator to the game I'm working on! So far only one level makes use of it (since most levels are better off being hand-crafted), but I have ideas for some other interesting levels that might use the maze generator.
https://journal.stuffwithstuff.com/2014/12/21/rooms-and-maze...
Next morning, I got an angry rebuke from the teacher. The mainframe operator had killed my program after it had run for quite some time, assuming it was an endless loop. It just turns out my program had some astronomical order of complexity.
I sure wish I still had the source code.
Maze generation algorithms [1] are great fun. This book chapter [1] details the development of my 198X IOCCC maze generation submission re-discovering Eller's algorithm.
Surprisingly the linked generator does not seem to have any choice of different maze algorithms? I guess it only uses one of the perfect algorithms then, meaning all possible mazes have equal probability. Those tend to be pretty boring. I think the biased algorithms often create more interesting mazes.
(EDIT: I see after reading some other comments here and the Help page that the E and R values can be set to create more biased mazes which sounds useful.)
Jamis Buck's Maze algorithm page is a great resource and the book he wrote about programming mazes is even better. It has nice visualizations of how the biases from different not perfect algorithm creates different patterns of mazes.
https://www.jamisbuck.org/mazes/
Implementing and visualizing different maze algorithms is probably my favorite kind of exercise when trying some new programming language (or things like game frameworks/libraries). Most of the algorithms are very easy, so there are no distractions from trying to get the logic right, but there are still some data-structures to play with and a bit more weight than Hello World.
Although maybe instead of that just being an input field under "Advanced", its effect should be explained for us folk who don't know what those settings mean.
Is there any curated collection of such generators that includes math and word problems for various grade levels as well? Or crosswords and other small games etc?
E-value - Controls the elitism tendency of the generation algorithm. An elitist maze has a short solution relative to the size of the maze, while a non-elitist has a solution going through a larger portion of the maze.
R-value - Controls the river tendency of the generation algorithm. A maze with a high river factor has few but long dead ends, while one with a low river factor will have many short dead ends.