I first learned about Processing at Maker Faire in 2011. I don’t consider myself a visual artist, but Processing made it straightforward to create beautiful graphics using code. However, I didn’t want to go through the hassle of working with the Processing IDE, so I set it aside for a couple years.
Naturally, I chose to implement Conway’s Game of Life. First publicized in 1970, it has fascinated many over the years due to the complexity of patterns that it produces based on a few simple rules. YouTube is full of videos depicting this cellular automaton; one of my favorites is this one taken of an installation on the Boston Greenway that I got to see in person. For Inception-level brain melting, there’s Game of Life in Game of Life. My favorite among the common patterns that arise is the glider since it always seems like it’s on a mission.
So here it is! You can reset the game by clicking anywhere on it, or you can wait five minutes and it will reset itself. I experimented with some crazier color shifting patterns as I was developing it, but I settled on a subtly undulating rainbow that I think would make for a good screen saver. Besides increasing performance to allow for a grid with more cells, the code could also be improved by adding a method for determining when the game has reached a steady state. One way would be to cache the previous few generations and compare the current generation against them, but computationally that could have a terrible worst-case performance. I’m open to suggestions! The source code is available here.