by moses-palmer · 2y ago · 0 comments
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)!
(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 :)
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.