3 ms·
Guess triangular and hexagonal grids are somewhat rare, but not exactly unknown. I remember the Programming Clojure book included a maze-generator that was show
by livrem 3y ago
Guess triangular and hexagonal grids are somewhat rare, but not exactly unknown. I remember the Programming Clojure book included a maze-generator that was shown for both square and hex grids (and could probably be easily modified for triangles as well?).
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/ 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.