GitHub 4 Life

A four-color game of life based on your GitHub contribution graph.

ethomson

What's this?

This is "GitHub 4 Life" - so named because it takes a GitHub contribution graph and turns it into a 4 color Game of Life.

The GitHub contribution graph is used as the initial state for Conway's Game of Life, a popular cellular automaton that is often built by beginning software developers as an easy-to-implement but interesting piece of software.

Conway's Game of Life only defines two initial states for cells, but there are multi-color variants. This is a variant of "Quad Life" (chosen because the GitHub contribution graph has four colors that represent the intensity of contributions for a given day): in the typical Game of Life rules, a graph with a lot of contribution would die out in the first iteration (because the cells would be overcrowded), which seems to punish those with a lot of contributions, giving them a boring Game of Life. Intead, this variant "decays" the level of contribution, so cells will fade away instead of dying immediately.

How does it work?

This uses a JavaScript library called contributions to create a data structure with a GitHub contribution graph, and uses that as the initial state for another JavaScript library called dat-life. The github4life application then renders this as an animated GIF. It does this indefinitely; it will render the game of life on-demand - infinitely continuing to deliver you the next state as a new frame in the GIF, forever.

By Edward Thomson, 2020.