Hacker News new | ask | show | jobs
by moses-palmer 907 days ago
This, I presume, it's the perfect opportunity to promote my own maze generator[1], which incidentally is a Real Application that you can run on your own computer, and the output of which you own!

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)!

[1]: https://github.com/moses-palmer/labyru

5 comments

I'd love to see a screenshot before downloading/installing.
It's a command line program that outputs SVGs. Here's an example: https://paste.sr.ht/blob/d248dd89f96c6de981bf0870265a63be8e1...

(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.svg
https://codepen.io/junon/pen/Rwdwqxg

For anyone who can't render SVG in their head :)

Basic question: What would be the simplest way to "digitize" one of these mazes i.e. turn them into a programmable data structure (2D array, matrix, etc.) for example to use as input into a maze solver/RL demo?
The main application is actually a thin wrapper around a library that does exactly that, so the best way would be to not perform the final step of turning the data structure into an image.
Can you add a license?
Is there a web demo?
No, you'll have to exercise your own CPU I'm afraid!
Your readme is pretty thin on information. How do I even run this? How can I configure the parameters?
A kind soul contributed an update to the README---basically the output of `cargo run --bin maze-maker -- --help.

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!

A friend of mine does coding live streams on Twitch. It's pleasantly surprising how many randos (who become internet friends) will help out with your projects.
Many human engineers get happy chemicals from helping people! Also many humans!
What are the methods available?

--method <METHOD> The initialisation method to use

Looks like "braid", "clear", "branching", or "winding" https://github.com/moses-palmer/labyru/blob/master/maze/src/...
Yeah, I was hoping the `clap` macros would perform some unthinkable magic there... I will have to update the help with a listing.

In the mean time, have a look here[1] for the possible values.

[1]: https://github.com/moses-palmer/labyru/blob/7b92be3ae279a9ff...

`clap` does have magic for enums:

  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.