Live data from Hacker News

Maze Generator

mazegenerator.net

41–50 of 56 posts

Re: Maze Generator

#41

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 image…

Can you add a license?

Re: Maze Generator

#42

> the mazes from this site are not free to use for commercial purposes. If you are planning to use them in something you will sell, you need to get a commercial license. There are already several online maze generator whose output is free for commercial use. What's so special about this one?

Doesn't have to be special, the creator just wants to be compensated if you're using it for commercial use. You're free to go to other creators if you want.

Or just ignore it lol

Re: Maze Generator

#43

I discovered this book in an HN comment, it's only right I post it here as well http://www.mazesforprogrammers.com/

This is an enjoyable book! It's an easy read, and the code is nice and straightforward. It avoids getting lost in any programming weeds, revealing the maze algorithms and techniques clearly.

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.

Re: Maze Generator

#44
post #15

Earlier quoted context omitted.

Which ones? Can you show an example of such a maze generator? It’s hard to compare otherwise.

Just a few from a quick search: https://mazesforfun.com/maze-generator https://puzzlemaker.discoveryeducation.com/maze https://multimazegenerator.com/ https://keesiemeijer.github.io/maze-generator/

That first one looks suspiciously similar to OP's.

Re: Maze Generator

#46
When I was 21, I had a friend who could draw these by hand. Crazy. It always blew me away. I was amazed. She'd know how to draw them and know they only had 1 solution too, but she'd have to figure out the solution IIRC. It freaked me out. Aside from that, she was "normal", relatively. Mad respect :)

Re: Maze Generator

#47

Earlier quoted context omitted.

What are the methods available? --method The initialisation method to use

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   description [default: bar] [possible values: bar, baz]
This is with clap >= 4.4 with the derive feature.

Re: Maze Generator

#48
Back in high school, I wrote a maze generator in BASIC, that printed the maze using ASCII characters. Then I figured out the biggest maze that would fit on a sheet of 132 column green bar paper, and submitted the job to the mainframe computer.

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.

Re: Maze Generator

#49

Earlier quoted context omitted.

Just a few from a quick search: https://mazesforfun.com/maze-generator https://puzzlemaker.discoveryeducation.com/maze https://multimazegenerator.com/ https://keesiemeijer.github.io/maze-generator/

That first one looks suspiciously similar to OP's.

Uncanny how two UIs for a program with a small number of parameters, which output the same kind of thing, can look so similar. I call shenanigans!

Re: Maze Generator

#50
When my kids were smaller, they would often request that I make mazes for them on restaurant placemats, etc. Since I was working in crayon, many of the traditional maze generation algorithms, which relied on removing walls, were inapplicable.

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.

Post reply on HN