- Paperback: 286 pages
- Publisher: Pragmatic Bookshelf; 1 edition (July 25, 2015)
- Language: English
- ISBN-10: 1680500554
- ISBN-13: 978-1680500554
- Product Dimensions: 7.5 x 0.6 x 9.2 inches
- Shipping Weight: 12.6 ounces (View shipping rates and policies)
- Average Customer Review: 17 customer reviews
- Amazon Best Sellers Rank: #563,175 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Mazes for Programmers: Code Your Own Twisty Little Passages 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
See the Best Books of 2018 So Far
Looking for something great to read? Browse our editors' picks for the best books of the year so far in fiction, nonfiction, mysteries, children's books, and much more.
Frequently bought together
Customers who viewed this item also viewed
From the Publisher
Q&A with Jamis Buck, author of Mazes for Programmers
It has to be asked: Why mazes?
You know, I came to programming because it fascinated me. There was something magical and wonderful about it---this idea that I could write a few commands in some cryptic syntax and make something happen. It was powerful! I don't think I'm unique that way. I think a lot of us come to programming like that.
But somewhere along the line we generally lose that sense of the magical. Maybe it gets drowned in the mundane tasks we typically use these amazing tools for, I don't know. But when the magic goes away, so does the wonder. So does the fun.
For me, mazes take me back to those days when programming was fun, when I'd sit down and start coding simply to see what might happen! Every random maze is unique, and the algorithms lend themselves well to variation and experimentation. It becomes this iterative game of "what if," for me. What if I make this condition more or less likely? What if I disallow this set of cells in the grid? What if I use color to visualize this or that aspect of the maze?
So, why mazes? Because they bring the wonder and the fun back into programming.
How did you come to write this book?
Would you believe there aren't any other books solely about maze algorithms? I couldn't. There are lots of great resources online about them, but if you want to learn how to generate a maze in more than just one or two ways, you wind up having to do a fair bit of research. You glean a bit of information here, a bit more there, you tinker and experiment until you get something working, and then you do it all over again for the next algorithm.
Some years ago I wrote a series of blog articles summarizing my own explorations in just this vein, and they were pretty well-received. Some readers suggested I write a book...and I'm embarrassed to admit that it took me a few years to take them seriously. But I did, and here I am!
Why are there so many algorithms for generating mazes?
You can't write software for very long before realizing that there are lots of different ways to solve problems in code. There are at least a dozen different ways to sort information, for instance, and each one has different strengths and weaknesses. Just so with maze algorithms, too. Depending on your need for memory efficiency, speed, and esthetics, the variety of maze algorithms let you choose one that will best fit your needs.
Besides, life would be a bit less wonderful if there were only one way to generate mazes. I like to celebrate the fact that there are that many more things to explore!
About the Author
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.
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
This book was a good starting point. I was surprised to discover that a maze is essentially a spanning tree representation. Even more surprising was to see algorithms like Dijkstra, Kruskal, Prim, random walk, typically used in networking or EDA (Electronic Design Automation tools - compilers for chips) to generate complex mazes.
One thing I didn't like about the book was the choice of Ruby programming language. Python or C++ would have been a much better option, in my opinion.
I would get up every morning around 4am just to work through a new algorithm! I first had to learn just enough Ruby to read the sample code before converting it to C#. But this process of going line-by-line forced me to understand what was actually going on. An unexpected side effect was that it forced to learn some interesting concepts about dynamically typed languages (Ruby) and see how they could be used to improve my C# (which is a statically typed language).
My only gripe is that I couldn't do some of the weaving algorithms because I couldn't find a good ASCII-to-PNG converter for .NET to pick up on the visualizations that are needed for those. Also I never managed to get the Masking Grid and Recursive Backtracker algorithms to display nicely because of some oddities with .NET's System.Console implementation (at least that's what I've concluded).
I had so much fun working through this book and building my own twisty little passages
What I can tell is, it has a lot of breadth. What I may not like about it is: it may not be as modular as it could be. Being a programming book, I don't know if they get into the computational complexity, the efficiency of the maze algorithms.