Cellular Automata
This week’s Ruby Quiz is a one-dimensional cellular automata. I wrote a quick (and oh so dirty) solution which I’m not going to submit, but I rarely submit my solutions so it’s no surprise to me. It even generates images via RMagick, though I could have easily generated PPMs which only require the ability to write bytes to a file. I always forget about PPM. I was actually excited to use RMagick since it turned out to not be very hard to install on OS X (anymore, at least).
Inspired, I wrote a quick (and less dirty) script for generating animated gifs of honest-to-goodness two-dimensional cellular automata, like Conway’s infamous Game of Life.
What I need to learn now is one of those GUI toolkits to figure out how to have an animated canvas. Instead of just dumping images out, it’d be nice to be able to observe (and interact, even) with an unboundedly-long-running world.
Until then, though, I have this:
