The maze book for programmers!
PragProg Amazon BN.com

Algorithms, circle mazes, hex grids, masking, weaving, braiding, 3D and 4D grids, spheres, and more!

DRM-Free Ebook

The Buckblog

assorted ramblings by Jamis Buck

Feb 2016

Living with Your Eyes Open

6 February 2016 — The author shares some experiences in which learning came completely by surprise — 6-minute read

A couple of years ago, I was struck by how much there was to learn. I tweeted this:

I’m still convinced of the truth of that statement, but as I’ve reflected on it, and reflected on my own “learning history”, I’m realizing that the things I’ve learned have often come out of left field, entirely unexpecteldy.

Serendipitously, even.

If you live your life focused entirely on one thing, one passion, you’re going to miss out on some amazing opportunities to learn things you would never have anticipated.

Let me give some examples.


When I was a senior in high school (class of ‘92 REPRESENT) we had a foreign exchange student from Italy by the name of Stefano Mazzocchi. He and I shared an interest in computers, and programming, and because the “computer science” class at our school was really more about word processing than writing software, the teacher kind of let Stefano and I build our own curriculum.

I distinctly remember one day in class, looking over Stefano’s shoulder as he demonstrated a program he’d written. I watched in fascination as a maze emerged on the screen–randomly generated! He explained how it worked, using a technique that I would later learn was a variation on the Hunt-and-Kill algorithm.

It was exciting, and fun, and I was kind of blown away by how simply it all worked.

Did I do anything with it? Not right away. Not for years. I wrote a random dungeon generator for D&D 3e, where I dusted off the algorithm Stefano had showed me, and I used that algorithm periodically over the years to experiment with new programming languages, but it wasn’t until the end of 2014, when I started work on Mazes for Programmers, that it all really started to gel for me.

That chance demonstration in high school was suddenly the catalyst for something significant. I never would have imagined that I would someday write a book about maze algorithms, but there you have it. I did.


In 2007 I started wondering what I would do if civilization were to collapse. (Right? Surely I’m not the only one who asks myself these kinds of questions. I mean, my entire skill set at the time revolved around manipulating electrons. I thought it would be wise to have a backup plan.) I don’t quite remember how it happened, but I settled on shoemaking as something that would be practical and useful in just about any situation, so I ordered a book on bespoke shoemaking and started researching.

Now, nothing really ever came of the whole shoemaking thing. (Yet. Who can say what next year holds?) But as I was reading about shoemaking, there was a chapter talking about lasts, these wooden models of feet that shoemakers build shoes around. And the chapter talked about a last-maker who harvested and cured his own timber and shaped the lasts and sold them to shoemakers.

Hmmm!

I pulled out my old pocket-knife, found a piece of wood, and started whittling. Not to make a last, but to see what I could make. I started reading about wood-carving, and discovered lovespoons. Before I knew it I was buying wood-carving tools–knives and chisels, and a leather strop, and whetstones, and vises. I bought a bandsaw for roughing out shapes. I finished my first lovespoon the day after my youngest son was born.

I carved other things. More lovespoons, chain links, captured balls. I even experimented with intarsia, and chip carving, and relief carving. I really liked working with wood, a fact that I would never have expected of myself.

And all because I started researching shoemaking!


Around that same time, my wife brought home a new book for our kids. It was one of those Klutz books, about Cat’s Cradle. I flipped through it and smiled, remembering suddenly that, as a kid, I’d learned a few of those games.

I watched as my wife showed my kids how to do Jacob’s Ladder, and I wondered–idly–if there was any more information about these games online.

Oh, boy.

An entire world opened up. There was even an International String Figure Association, founded to “gather, preserve, and distribute string figure knowledge”. I learned that string figures were ancient, and practiced by nearly every culture on just about every continent.

Who knew? This was fascinating stuff! I joined the ISFA, purchased as many books and periodicals about string figures as I could find, and started carrying a loop of string with me everywhere. (I’ve got a loop in my pocket right now, in fact.)

I even gave a presentation at the 2009 Ruby Hoedown in Nashville, in which I compared string figures to the craft of software development. (I wrote a series of essays based on that presentation, called There is no magic, there is only awesome.)

All because my wife happened to buy a simple children’s book about string games. I never would have predicted what might have come of that.


Another story, related to knots and loops. I was at a Basecamp meetup in Chicago in 2011, when Sam Stephenson called me over to where he was sitting. He had a couple of bow ties on the table in front of him, and explained that he’d picked them up at a flea market and wanted to learn how to tie them. He said he thought it might be something I’d be interested in, too, and invited me to join him.

I would never have guessed it, but he was absolutely right. We had a blast trying to figure out how to tie them, and when I returned home after the meetup I was determined to find some bow ties and wear the heck out of them.

Only, bow ties were surprisingly expensive. I looked at them and thought, how hard can it be to make them?

More research. My wife has a sewing machine, but I’d never used it. I’d never sewn anything, except for that bean ball back in a middle school arts-and-crafts class. But I was motivated to learn.

I wound up reverse engineering a bow tie pattern, locating some spare fabric, and getting to work.

I made another one. And then another. I got better at it. I wound up making quite a few. Today, I know how to use a sewing machine, and bow-ties have almost completely supplanted neckties for me.

All because Sam thought that tying bow-ties would be something I might like. And he was right!


One more story, around that same time. I was sitting in a dentist’s office, waiting for my name to be called so I could go get my teeth cleaned, and have the inevitable cavity filled. Naturally, to kill time, I picked up one of the magazines and started flipping through it.

It was a food magazine. I think it was “bon appétit”. All I remember for sure was that there was a tiny article buried in the middle of it, about making marshmallows.

I was intrigued. I had no idea they could be made. At home, I mean. I figured it took all kinds of industrial strength machinery to churn those little confections out.

When I got back from the dentist, I hopped online and found a marshmallow recipe. I tried it out, but accidentally put too much mint flavoring in. The result was something like toothpaste-flavored candy, but I was in obsession-mode now. I was determined to figure this out. I think I made at least one batch of marshmallows each day for several weeks, experimenting, taking notes, and enjoying the batches that turned out.

Delicious! And after I came up for air and looked at what I’d accomplished in a few weeks in the kitchen, I realized that I actually really enjoyed cooking! I started branching out, experimenting with other foods. I’m no sous chef, but I’m far more confident in the kitchen now than I’ve ever been before.

All because I took a moment to be curious about an article in a food magazine.


There are amazing things to learn wherever we are, and everything we learn expands our ability to think about and notice more things. It’s an educational domino effect!

Give yourself permission to be curious about things. It’s improved the quality of my life immensely.

Jan 2016

Software Proverbs

30 January 2016 — Four Korean proverbs, applied to software development — 4-minute read

Mazes in Swift

23 January 2016 — A first foray into Apple's Swift programming language, using maze algorithms as the incubator — 4-minute read

A Pretty-Printer for SQL

16 January 2016 — A project is announced that provides a simplistic parser and pretty-printer for a subset of SQL — 2-minute read

Don't Assume It's Difficult until It Is

9 January 2016 — The author shares three experiences which have taught him to reserve judgement on which parts of a task will be the difficult ones — 5-minute read

Game Demonstration: Recover the Widgets

2 January 2016 — 6-minute read

Dec 2015

Checking In...

26 December 2015 — 1-minute read

Avoiding "Call Super" with Callbacks

19 December 2015 — 5-minute read

Little Things: Introspecting Block Parameters

12 December 2015 — 1-minute read

Integration API vs. Internal API

5 December 2015 — 3-minute read

Nov 2015

Upsilon Mazes

28 November 2015 — 9-minute read

Representing a Toroidal Grid

21 November 2015 — 11-minute read

Little Things: Refactoring with Hashes

14 November 2015 — 2-minute read

Fifteen Minutes at a Time

7 November 2015 — 5-minute read

Oct 2015

Mazes with Blockwise Geometry

31 October 2015 — 5-minute read

Testing What You Should Have Written

24 October 2015 — 3-minute read

The Dynamic Def

17 October 2015 — 8-minute read

Bulk Inserts in ActiveRecord

10 October 2015 — 2-minute read

Changing the Channel

3 October 2015 — 3-minute read

Sep 2015

Generating Word Search Puzzles

26 September 2015 — 5-minute read

Default Scopes are an Anti-Pattern

19 September 2015 — 4-minute read

Little Things: Heredocs

12 September 2015 — 3-minute read

Little Things: Hashes & Procs

5 September 2015 — 3-minute read

Aug 2015

Ideas are Cheap

29 August 2015 — 3-minute read

Reducing a Number to Its Sign

5 August 2015 — 2-minute read

Writing a Klondike Puzzle Solver

4 August 2015 — 9-minute read

Jul 2015

Writing a Simple Recursive Descent Parser

30 July 2015 — 5-minute read

tar.gz in Ruby

23 July 2015 — 3-minute read

Mazes for Programmers

8 July 2015 — 1-minute read

May 2015

Experimenting with L-Systems

7 May 2015 — 5-minute read

Way Back

The Buckblog Archives

Dating to 2004 — Hundreds more articles