A while back, I wrote Turing Drawings, a JavaScript web app which uses randomly generated Turing machines to produce animated drawings on an HTML5 canvas element. The web app, due to its addictive nature, ended up being featured a few times on Reddit and Hacker News, and was even forked by developers who added interesting new features to it. Since then, I’ve been pretty busy working on Higgs and my PhD thesis, and I haven’t taken the time to work on fun little hobby projects of the sort. That is, until last night.

Thanks to the fine work of Tommy Everett, Higgs now has a 2D drawing library based on X11 with functionality resembling that of the canvas element. I decided to dogfood Higgs and its drawing library by writing a new program inspired from Turing Drawings. This program, which I’ve named Turing Turtle, uses randomly generated Turing machines to control a turtle-style plotter. The machine has an internal tape used for storage, and can perform a number of output actions, such as moving forward, turning left or right, as well as changing the current drawing color. This can produce a variety of interesting drawings, as shown below (click to enlarge):

I’ve uploaded an album with many of these drawings on imgur. I find that randomly generated Turing machines are a simple and effective way to drive generative processes in which you’d like to see repeating patterns emerge. If you’d like to try Turing Turtle for yourself, I’ve added the program to the examples directory of the Higgs repository. You can use the arrow keys to generate new drawings, restart the current drawing as well as increase and decrease the plotter speed. It’s a very fun little program to play with.