February 17, 2018
golang maze image ascii art side project mazey mcmazeface

Word Count: 341

History

I have always loved making mazes. Way back in middle school, I would hand draw mazes all the time. They were something that I used to pass the time and gave me something creative to focus on. Well, fast forward a number of years and, when I have paper and something to write with, I still am known to handcraft mazes.

Nostalgia

As a side project, around 2013 while I was on vacation, I created a maze generator in Haskell. It was basic but it generated a maze grid then it would output some HTML to display it. There was a checkbox to show the pre-computed solution and you could click a cell to toggle its color to add/remove to your path. Other than that the details and pictures/evidence have been lost to time (read: I can’t find the files anywhere).

One day I was feeling particularly maze-y and was reminiscing about my Haskell maze generator so I started practicing my Google-fu. Eventually, I ran across this awesome blog post from Jamis Buck and I was inspired even more.

Not so History

Long story short, I bought his book Mazes for Programmers. after reading his blog post. Then after working through Chapters 1-2 of the book in Golang (the book is written with Ruby examples), I generated the following image:

Very Basic Binary Tree Generated Maze

It follows a basic binary method for picking the next cell to unlock, it goes row by row and picks either up or right (until it hits a wall). For the ascii to image generation portion, I stole from my previous work from the ascii art side project. It required only minimal changes to start generating images.

Next steps

Obviously, I will keep working through the book. But one thing I plan on doing for sure, is a little recreation of my Haskell project.

Once I work through the book and get a feel for how I want to structure things to be more generically applicable, I plan to open source a maze generator library and/or cli. So, stay tuned!