Dogfooding Higgs with the Turing Turtle
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.
This is really awesome!! I love the concept of everything being a valid program.
You inspired me to try to make my own version of this:
http://www.andrewalexanderprice.com/software/tackyturtle/
Click ‘Play’ then keep clicking ‘Randomize’ and watch the fun.
My encoding is different, I have 13 ‘instructions’ including some control flow ones. It’s very interesting to see how the same program runs differently simply by changing the tape length/states.
The page you linked unfortunately won’t seem to load in my browser at this time, neither in Chrome nor in Firefox.
That’s unfortunate. I’ve made a video of it instead: https://www.youtube.com/watch?v=fvhlZ5lADCA
Looks pretty neat. Turing machines and automatons of the sort definitely have much unexplored potential in the generative art space IMO.
Thanks! I’ve noticed it’s biased towards generating ‘spinners’ that keep circling.
Seeing as the turtle is operating in a closed environment (no user interaction, limited screen space, bounds on the tape length and states) it may be possible to prove that in a closed environment, any turing machine will eventually reach a state it has previously been in and will loop.