J
Jamis Buck
weblog.jamisbuck.org · Personal blog · on HN since 2007
Jamis Buck, a programmer, writes about software and is best known for his series on maze-generation algorithms with demos.
What HN saysHN commenters point to it as a great, thorough resource on maze generation, with posts on each algorithm and a recap.
110HN people shared it
69linked it in comments
83stories submitted
1.8Kstory points
9 months agolast shared
2007people per year2026
Most-shared posts
- 1Maze-generation algorithms, with JS demos18 people · 62 points · first shared 2011 · 9 comments on HN
- 2Maze Algorithms (2011)14 people · 138 points · first shared 2011 · 22 comments on HN
- 3LEGOs, Play-Doh, and Programming10 people · 25 points · first shared 2008 · 1 comments on HN
- 4Maze Generation: Eller's Algorithm8 people · 85 points · first shared 2010 · 9 comments on HN
- 5"Algorithm" is not a four letter word5 people · 444 points · first shared 2011 · 65 comments on HN
- 6Coming home to Vim5 people · 66 points · first shared 2008 · 34 comments on HN
- 7Maze Generation: Recursive Backtracking5 people · 7 points · first shared 2010 · 1 comments on HN
- 815 Great Maze Generation article with HTML5 demo4 people · 1 points · first shared 2011 · discussion on HN
- 9Skinny controller fat model4 people · first shared 2008
- 10Maze Generation: Weave mazes3 people · 52 points · first shared 2011 · 3 comments on HN
- 11Homepage3 people · first shared 2011
- 12The Dynamic Def – abusing Ruby's def statement2 people · 142 points · first shared 2015 · 86 comments on HN
- 13Maze Generation: Wilson's algorithm2 people · 101 points · first shared 2011 · 11 comments on HN
- 14Ideas are Cheap2 people · 98 points · first shared 2015 · 63 comments on HN
- 15Maze Generation: Recursive Division (2011)2 people · 51 points · first shared 2011 · 12 comments on HN
What HN people wrote when they linked it
johnsonjo · 2018-02-25
Yeah, it’s a good book with great visuals. The author, Jamis Buck, actually lives in my town. He visited my University and gave a lecture on generating a Zelda like over-world by using maze algorithms. It was an interesting application. Jamis writes in Ruby and helped with Ruby on Rails. He has a good blog too [1].
[1]: http://weblog.jamisbuck.org
butlersean · 2025-10-12
many examples of of maze generation algorithms (with source code) here. https://www.jamisbuck.org/mazes/
i bought his book totally worth it http://mazesforprogrammers.com/
fn-mote · 2025-10-11
Here is one article in an excellent series of articles on make generation:
https://weblog.jamisbuck.org/2011/1/20/maze-generation-wilson-s-algori…
bradrn · 2024-02-11
You might enjoy this: https://www.jamisbuck.org/mazes/. The section headers link to his (IMO really excellent) articles about maze generation algorithms, plus there’s a more comprehensive book you can buy.
(I doubt kid’s mazes are made using these precise algorithms, but either way they’re interesting!)
forrestthewoods · 2019-01-27
Great link. Here's another good one.
https://www.jamisbuck.org/mazes/
tarentel · 2016-10-10
http://weblog.jamisbuck.org/
or if you click on the name of the algorithm in the url you posted it brings you to the blog post about it.
hugofirth · 2015-08-22
Every time these kind of submissions come around, I feel it necessary to give a shoutout to Jamis Buck's great series of blog posts and examples on the topic: http://www.jamisbuck.org/mazes/
Part of my undergraduate dissertation involved generating random mazes - and these articles were a godsend.
jschulenklopper · 2015-05-26
For a great collection of maze generation algorithms, see the blog of Jamis Buck. On http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap.h… he recaps the algorithms discussed in earlier posts, and he's publishing a book on the topic: Maze for Programmers. It's currently in beta on the Pragmatic Bookshelf: https://pragprog.com/book/jbmaze/mazes-for-programmers. Can't wait for the hardcover book, currently planned for September 2015.
gavanwoolery · 2014-12-22
Looks good! I found this to be a great resource on Maze generation:
http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
100k · 2014-07-25
I wasn't at RubyConf 2004 (back then I thought Ruby was some weird Perl-ish language from Japan, not worth my attention) but for my RailsConf talk I dug up some old blog posts about what it was like when DDH first spoke about Rails at that conference.
Jamis Buck was there: http://weblog.jamisbuck.org/2004/10/2/rubyconf-day-two
Francis Hwang: http://fhwang.net/2004/10/03/RubyConf-2004-Day-2
It's amazing how few people were there and how marginal Ruby was in 2004.
tfinniga · 2014-07-15
I think the short answer is that the maze will look very different. It's very possible that the verts of the maze would be in exactly the same position, since that's a regular pattern. But the maze walls will be extremely random.
Maybe the best way to get a feel for it is to take a look at this page of maze generators: http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
itp · 2014-03-24
Jamis Buck has a fantastic series of blog posts about maze generation[1]. It looks like he's no longer updating the blog, but all of the entries are still up. Start at the bottom and work up.
[1] http://weblog.jamisbuck.org/under-the-hood
jmduke · 2014-03-24
My favorite presentation ever, by Jamie Buck at RubyConf2011, is a great interactive survey of maze generation algorithms -- "Algorithm" is Not a Four-Letter Word:
http://www.jamisbuck.org/presentations/rubyconf2011/
wcarss · 2013-03-26
Glad to see someone mention Jamis Buck's excellent series on these. This recap[1] gives a good overview of the ground covered, with nice interactive bits.
1 - http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
malandrew · 2012-07-15
For some reason your comment reminded me of this classic from last year:
http://news.ycombinator.com/item?id=3054509
http://www.jamisbuck.org/presentations/rubyconf2011/
kragniz · 2011-09-29
The articles on his blog (http://weblog.jamisbuck.org/) give more in-depth explanations for those who dislike the slides.
timcraft · 2011-02-21
These were a great read. Full recap here:
http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
DanielRibeiro · 2011-02-10
Great point. This presentation showed how easy it can be to implement DI in ruby: http://onestepback.org/articles/depinj/index.html
Dynamic languages don't suffer many of the overheads with using DI. So do those with Mixins (see the Scala's Cake pattern for more on this http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection…
This blog post says more about it: http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-programming.
samdk · 2009-12-31
I was disappointed as well.
I do recommend the articles listed on the Rails wiki's 'Text Editors' page for Vim, though: http://wiki.rubyonrails.org/text-editors
(Listed here in case that page is changed: http://weblog.jamisbuck.org/2008/10/10/coming-home-to-vim,
http://weblog.jamisbuck.org/2008/11/17/vim-follow-up,
http://biodegradablegeek.com/2007/12/using-vim-as-a-complete-ruby-on-r…
livrem · 2023-12-22
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/
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.
Yoric · 2020-02-22
Well, the big one is GC.
Here are a few others:
- both polymorphic variants and GADTs are extremely powerful mechanisms to let you keep track of invariants, in a manner that cannot be replicated readably in Rust so far;
- OCaml's pattern-matching is a bit more flexible than Rust's ;
- (thanks to the GC) OCaml's closures are much more flexible than Rust closures;
- I guess OCaml's blindingly fast exceptions can be useful for some algorithms, although I haven't really experienced the need for them myself.
Again, that's not to say that Rust doesn't have great stuff for it (affine types 4eva!) or that OCaml doesn't have its own limitations – Rust is currently my main language and I do not regret it.
But there are some algorithms that I really don't want to write in Rust. Recently, for instance, I stumbled upon this: http://weblog.jamisbuck.org/2010/12/29/maze-generation-eller-s-algorit… . Trivial algorithm, trivial to write in OCaml, feasible but much less straightforward in Rust.
Jach · 2012-04-13
> Not only do they help the student with writing code, the introduce important parts of programming as well as Big-O notation.
Are sorting algos the best methods for helping students write code and learning about Big-O? I don't think so. Learning the fundamental data structures are a lot more useful for that purpose, I think. Of the standard crop, I think the binary search is a good algorithm to teach (though one must note its historical implementation problems in languages with fixed int sizes), and if you're going to do sorting then quicksort + insertion sort when N < 16 wouldn't be awful. At least mention the language's built-in sort so that open source projects like gnu flex don't inherit a DIY sorting function in the code (in their case, the evil bubble sort which should never be taught).
Instead of the cast of characters for sorting algos, I'd rather see something like this cast of maze generation algos: http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap I think they would accomplish your goals better, plus they have shininess built-in.
>…"Lets learn Unity3D" course in front of me, I would never ever attend that university.
But you would probably still be doing programming and CS elsewhere. You're already set. This post is about trying to attract people into programming at the HS or college level who otherwise wouldn't be. But from the other comments it seems like I might agree with you specifically on Unity3D; I haven't used it myself but it…
zazaulola · 2024-08-25
This article is more complete and more interactive:
https://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
Code for generating mazes in different languages can be found here:
https://rosettacode.org/wiki/Maze_generation
loupol · 2023-12-22
Haven't read the book, but the author wrote multiple blog entries about different maze generation algorithms[0] prior to its publishing which I found personally useful.
[0] http://weblog.jamisbuck.org/archives.html (the maze posts date from early 2011)
CobrastanJorji · 2022-09-12
Maze generation is one of those hobby areas of computer programming that just keeps going. It's really cool how many ways there are and how different the resulting mazes look. Here's an old blog post with visualizations for several popular ones: https://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
mysterydip · 2022-07-09
Really neat. There was a maze generation algorithm in BASIC when I was younger that created the maze one row at a time. I couldn't wrap my head around how it was possible to make a maze like that. Searched for it recently and found Eller's algorithm: https://weblog.jamisbuck.org/2010/12/29/maze-generation-eller-s-algori…
eesmith · 2021-07-16
For those interested in the topic, see also https://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap and https://www.astrolog.org/labyrnth/algrithm.htm .
codeulike · 2021-05-03
Here's are some more interesting maze algorithms with proper live demos: http://weblog.jamisbuck.org/under-the-hood/
This one is really nice to watch: http://weblog.jamisbuck.org/2015/1/15/better-recursive-division-algori…
artistsvoid · 2020-06-19
Thanks to the author for sharing it in this open manner, I look forward to working with it.
I am sure it has been mentioned before on HN, but seems like a good place to share https://github.com/tuvtran/project-based-learning#python
Not so much about practicality, but I've been getting into puzzles and mazes lately https://www.jamisbuck.org/mazes/ (not yet bought his book, but will)
Happy coding to all :)
gliese1337 · 2019-12-18
This other referenced article helped me figure out why this was a big deal: http://weblog.jamisbuck.org/2010/12/29/maze-generation-eller-s-algorit…
Basically, you can lazily generate a maze of infinite length. That's pretty cool.