Conway’s Game of Life is a cellular automaton devised by mathematician John Conway in 1970. The Game of Life consists of a two-dimensional grid of cells, each of which is in one of two possible states: dead or alive. Every cell interacts with its eight neighbors and at each step in time, the following rules apply:
From these four simple rules, many interesting patterns can evolve. For example, the glider moves across the grid at a diagonal, much like the ♝ Bishop on a chess board:
The glider is a simple pattern that belongs to a more general class of patterns known as spaceships. A spaceship is any pattern that reappears after a certain number of generations in the same orientation but in a different position.
A knightship is a spaceship that moves two squares left for every one square it moves up, similar to the ♞ Knight on a chess board. It may surprise you to learn that the first true knightship was only recently discovered, nearly 50 years after the game’s creation!
Sir Robin was found by Adam Goucher on March 6th, 2018 using a searching program that extends partials. A partial is simply an intermediate object that might be used as part of a spaceship. Of course, partials themselves are not spaceships. They lack the key feature of being periodic. But, some come very close. Such as the Almost Knightship which was found back in 2004.
Generation 0 (left
) and generation 6 (right
) show that the pattern is different by
only two cells at the top right. So close!
Regl is a functional abstraction for wegbl with a data-driven style inspired by React.
Starting with the life.js example:
I created several helper functions to parse RLE strings into INITIAL_CONDITIONS
for
regl’s framebuffer data. Here’s the run-length encoding of Sir Robin:
and the following functions convert this string into something useable by regl’s framebuffer:
♞ Sir Robin in regl