A-mazing books

One of the tricks I commonly use when visiting a bookstore is to force myself to buy only one book. It can’t be the book reviewed last weekend in the New York Times, nor can it be a book I always intended read, it has to be unusual, unlike any of my past reading.

I use this trick while in Seattle, January 2017. We had just watched the Chinese New Year street parade, with long dragons dancing down the street, followed by acrobats and dancers. With my mind charged with the exotic, I entered the downtown Barnes& Noble store where I preceded to shop. It’s common with me when picking just one book to select a translation of a foreign novel or a new edition of poetry by a poet I have never read. However, my one book has never addressed computer programming. But, when I saw “Mazes for Programmers: code your own twisty little passages” and read the back cover comments, “A book on mazes? Seriously? Yes! Because it’s fun. Remember when programming used to be fun?”, I was hooked.

Over the next several weeks I read the book cover to cover trying to understand all of the examples. One problem I had is, the author of the book had written all example code in Ruby, a language which I have never used. I had selected Python as my one language of choice to use for retirement hobby computing. The difference between two computer languages, even though they are in some ways similar, as Ruby and Python are both object-oriented languages, is complex. It’s like the computer translation of human communication. For an example of this difficulty, I took the first sentence above and translated it from English to Italian to Hungarian and back to English with Google translate, this is the result:  “One of the trick I buy in a bookstore is to force myself to choose only one book”

The problem of languages was solved when I discovered Sami Salkosuo’s posting of mayzepy on GitHub.  Someone else had done the hard part for me.  My work would now be concentrated on the creation of different maze types and the rendering of those mazes as computer drawings.

Almost immediately, as I started to render mazes, I realized that eventually, my software drawings would need to reference the past.  I needed to understand the stories of ancient mazes in Eygpt, the Greek myth of the Minotaur, and the meditative wall and pavement mazes of the medieval church.  Luckily the Buffalo library had a copy of “Mazes and Labyrinths: Their History and Development,” by W. H. Matthews.  I checked it out, and as I read it, I knew I wanted a copy for reference.  At this point, I discovered Amazon had a kindle version for $2.99.

Another direction of study when constructing mazes is the mathematics field of Graph Theory.  A “Perfect Maze,” one without loops, is a “Connected Tree” in graph theory.  The text I have been studying is “Pearls in Graph Theory” by Hartsfield and Ringel. I recommend it.

Finally here are examples of my computer generated mazes.

saved7polaryellowHorizon2

 

 

3 thoughts on “A-mazing books

    1. I will be providing a detailed answer, with computer code in a future post. For now, I compute the distance off the path from a start point to a goal point and paint by numbers.

  1. Pingback: First maze notebook – Doug's Paws

Leave a reply to doug14226 Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.