Michał "lcamtuf" Zalewski's Conway's Game of Life Board Packs Hundreds of Dollars in Switches
Self-illuminating LED switches, at $3 a throw, make up the bulk of the bill of materials for this physical life sim.
Security researcher Michał "lcamtuf" Zalewski has built a rather pricey physical implementation of Conway's Game of Life — where every cell in the simulation is represented by a physical light-up switch.
"A while back, I posted the following on social media: 'I have this intrusive thought that I should spend a lot of money on between 256 and 400 illuminated tactile switches and make a physical version of Conway's Game of Life,'" Zalewski explains. "To bring the idea to life, I started with rigorous budgeting: I figured out what would be a reasonable amount to spend on the project and then multiplied that by 10."
Conway's Game of Life was created by mathematician John Horton Conway in 1970 as a "zero-player game" — a cellular automaton that runs itself. Interaction is possible by deciding which squares in its simulation grid represent "live" cells, then the simulation proceeds by basic rules of underpopulation, overpopulation, and reproduction. Early experimentation involved graph paper, pencils, and patience; these days most implementations of Conway's Game of Life are on a computer and capable of running at incredible speeds expanding across vast simulation spaces.
Zalewski's physical version is smaller, and uses as both its user interface and display a 17×17 matrix of illuminated LED tactile switches. These dominate the square board, leaving just about enough room for a Microchip AVR128DA64 to run the simulation itself. "The control scheme for the 'display' is uncomplicated," the researcher says. "Switch-integrated LEDs are laid out on an x-y grid. The first 17 MCU GPIO [Microcontroller Unit General-Purpose Input/Output] lines are used to connect a single currently-active LED row to the ground. The next 17 lines supply positive voltages to columns. At the intersection of these signals, some diodes will light up."
"To detect user input," Zalewski adds, for the method by which users can "seed" the simulation by positioning "living" cells, "I reused the row select line to pull the corresponding bank of switches to the ground, and then routed another 17 GPIO pins to sense whether the switches in that row are closed. Pull-up resistors for these signals are integrated on the MCU die. The UI [User Interface] is uncomplicated; the simulation advances at a rate dictated by the position of the knob, from 0 to about 10 Hz. The playfield is edited by pressing switches to toggle a cell on or off. Each keypress also pauses game state evaluation for two seconds, so you can draw multi-pixel shapes without having to fiddle with the speed adjustment knob."
The project is documented in full, including PCB Gerber files and source code, on Zalewski's blog. "The switches are around $3 a piece and account for the bulk of the price tag," the maker warns anyone looking to build their own. "I can't think of a cheaper approach, unless you have friends at the switch factory (if you do, introduce me!)"