Mazes for Programmers (PragProg)

A book on mazes? Seriously? Yes! Because it’s fun. Remember when programming used to be fun?

Explore a dozen algorithms for generating these puzzles randomly, from Binary Tree to Eller’s, each copiously illustrated and accompanied by working implementations in Ruby.

Mazes for Programmers

edited by Jacquelyn Carter @jkcarter

A book on mazes? Seriously? Yes! Because it’s fun. Remember when programming used to be fun?

Explore a dozen algorithms for generating these puzzles randomly, from Binary Tree to Eller’s, each copiously illustrated and accompanied by working implementations in Ruby. Understand their pros and cons, and how to choose the right one for the job. You’ll start by learning six maze algorithms and seeing how Dijkstra’s algorithm can help solve, analyze, and visualize mazes. Constrain your mazes to different shapes and outlines, such as text, circles, hex, and triangle grids. Cull dead-ends and make your passages weave over and under each other. Build your mazes in multiple dimensions, and even on curved surfaces.

Through it all, you’ll discover yourself brimming with ideas, the best medicine for programmer’s block, burnout, and the grayest of days.


“Mazes for Programmers_ perfectly recaptures that feeling of pure, unadulterated awesomeness for awesomeness’s sake. This will be a book I come back to again and again.”

–Corey Haines, CTO, Curious Nation


  • Full details: Search
  • View this book’s portal and details on how to post errata and suggestions here.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

2 Likes

This is one of my favorite programming books of all time. Such a simple idea but there is so much you can learn about algorithms, complexity, and programming (and mazes) just by writing some simple scripts to build mazes. Last time I read it I had some fun re-implementing all the Ruby in Python (I may try a functional language next).

4 Likes

Thank you! I’m so glad you’ve enjoyed it. :heart:

3 Likes

Looks like it could be a fun one for one of our book clubs :003:

I love the little bio at the end:

Jamis Buck is an alumnus of the Ruby on Rails core team, and has worked at Basecamp (formerly 37signals). He’s been active in open source for years, and has a deep passion for learning. Some years ago he began researching and writing about maze algorithms, and the bug never left him. He’s probably lost in a maze somewhere, right now.

:lol:

2 Likes

How much of the mazes/algorithms are useful in day-to-day programming? :slight_smile:

2 Likes

Depends on what are you trying to do, e.g. one can use it to improve their Ruby skills. I used one of the maze generating algorithms from the book to generate a PacMan like table. But the book deserves to be read because it is fun.

3 Likes

It would be nice. I am trying to solve the problems of this book using Python. Would be in if someone opens a book club on this.

3 Likes

For day to day it was mostly good practice debugging my own code. It’s also useful in learning about tradeoffs and efficiency of algorithms.

If you are a game developer these maze algorithms are great for creating dungeons and game levels. :crossed_swords:

2 Likes