“This book reminded me of a simple fact I sometimes forget: programming is fun.”
— Jeffrey Hardy, Programmer, Basecamp

Remember when coding was fun?

A book on mazes. Seriously!

Not because you spend your day creating mazes, or because you particularly like solving mazes.

But because it’s fun. Remember when programming used to be fun? This book takes you back to those days when you were starting to program, and you wanted to make your code do things, draw things, and solve puzzles. It’s fun because it lets you explore and grow your code, and reminds you how it feels to just think.

Mazes for Programmers will show you how to write programs to generate, draw and solve mazes. Map them into arbitrary outlines, wrap them around shapes, build them in hexagons and triangles. Learn twelve different algorithms, from the Binary Tree algorithm, to Eller's, each with different strengths and weaknesses.

Make programming fun again!

Available at these fine online booksellers

Peek inside: a sampling of pages from the book

Full Ruby source code for every algorithm!
Use colors to see differences between algorithms
Every algorithm is fully illustrated
3D and 4D mazes
Learn how to apply mazes to other surfaces
See how to compare algorithms quantitatively

Purchase the paperback or get the PDF

These are the mazes you’ll make...

Hex (Sigma) Mazes
Triangle (Delta) Mazes
Circle (Theta) Mazes
Weave Mazes
Braid Mazes
Mazes with Rooms
Fit Mazes to Shapes
Mazes on Möbius Strips
Mazes on Spheres

And many more, with dozens of project ideas for you to experiment with!

Here’s what everyone’s saying...

“Reading the book Mazes for Programmers is like a fun journey through a maze. There’s a good mix of simple explanations and working code, combined with ideas at the end of each chapter to inspire one to expand upon what was presented.”
— Walter Pullen, Author, "Think Labyrinth!" website

“Mazes for Programmers is full of nerdy algorithmic delight and is a really fun read!”
— Bruce Williams, CTO, CargoSense, Inc.

“Jamis Buck’s inspired choice of mazes as a unifying theme allows him to take the reader on a deeply engaging tour of an impressive array of algorithms and programming techniques. Mazes for Programmersis an exemplary book of its kind, ideal for programmers looking to take a break from tuition in specific programming languages and learn something of general interest and applicability within their craft.”
— David A. Black, Author, “The Well-Grounded Rubyist”

“My past 20 years as a software developer have taught me two things. First, I will probably never need to generate a maze. Second, and more important, pushing myself in new and unfamiliar ways is the best way for me to level up as a programmer. Sure,Mazes for Programmers will teach you how to generate mazes, but it will also give you one of the clearest step-by-step tours through algorithmic thinking you can find.”
— Chad Fowler, CTO, Wunderlist

“This is a fun, playful tour of all the concepts and algorithms you’d want to know for generating and solving mazes. If only this book existed when I was writing Maze Crusade!”
— Amanda Wixted, Owner, Meteor Grove Software

“I started programming because of the fundamental joy of making cool things just for the sake of making cool things. Jamis’s 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

Buy Mazes for Programmers today!