Skip to main content

gh-game-of-life

Transform your GitHub contribution graph into Conway's Game of Life.

Example

Usage

One time generation

Check out the web demo and generate a GIF in seconds without installing anything locally.

GitHub Action

Automatically update your game GIF daily using GitHub Actions! Add this workflow to your repository at .github/workflows/update-game.yml:

name: Update Game of Life Game

on:
  schedule:
    - cron: '0 0 * * *'  # Daily at midnight UTC
  workflow_dispatch:  # Allow manual trigger

permissions:
  contents: write

jobs:
  update-game:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: apoupon/gh-game-of-life
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          output-path: 'game.gif'
          strategy: 'random'

Then display it in your README:

![My GitHub Game](game.gif)

From PyPI

pip install gh-game-of-life

From source

# Clone the repository
git clone https://github.com/apoupon/gh-game-of-life.git
cd gh-game-of-life

# Install with uv
uv sync

# Or with pip
pip install -e .

Setup

  1. Create a GitHub Personal Access Token:

  2. Set up your environment:

    # Copy the example env file
    touch .env
    echo "GITHUB_TOKEN=your_token_here" >> .env
    

    Alternatively, export the token directly:

    export GITHUB_TOKEN=your_token_here
    

Usage

Generate Your Game GIF

# Basic usage - generates username-gh-life.gif
gh-game-of-life <username>

# Specify output filename
gh-game-of-life torvalds --output my-gif.gif
gh-game-of-life torvalds -o torvalds-life.gif

# Adjust the number of simulation frames
gh-game-of-life torvalds --frames 100
gh-game-of-life torvalds -f 200

# Control frame delay (milliseconds per frame)
gh-game-of-life torvalds --frame-delay 500
gh-game-of-life torvalds -d 250

# Load settings from a YAML configuration file
gh-game-of-life --config config.yaml

On Conway's Game of Life

The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is a zero-player game meaning that its evolution is determined by its initial state, requiring no further input. Despite being governed by just three simple rules, it can give rise to incredibly complex behaviors and patterns. The Game of Life is a perfect example of how simple rules can generate unexpected complexity.

A cool documentary on Conway's Game of Life can be found here: https://www.youtube.com/watch?v=Kk2MH9O4pXY

On the Quad Life variant

An interesting variation of the Life rules is to use several distinct living state, with each behaving according to Life rules, but, in addition, carrying independent color information. The color of each newly-born bit is determined by the color of its parents. Resulting patterns have exactly the same life/death behavior as in normal Life, but the colors of resulting bits provides interesting additional complexity.

This project uses the Quad-Life variant, which employs four symmetrical colors, creating vibrant, evolving patterns while maintaining the familiar Life behavior.

Coding with AI

This project also serves as an experiment in coding with AI assistants. I have been using LLMs in my development workflow for a while but had not yet explored specialized coding agents such as Claude Code, Cursor, or GitHub Copilot in Agent mode. For this project, I experimented with GitHub Copilot and Claude Sonnet 4.5, taking the project from initial idea to working implementation.

I drew inspiration from the BMAD method ("Build More, Architect Dreams") and followed a structured workflow: starting with a product brief, then moving through product requirement design, UX design, software architecture, and breaking work into epics and stories. Development and testing occurred in iterative loops, completing tests before moving on to the next story or epic.

It was smooth and fast.

Acknowledgements

I got the idea from czl9707's Github Space Shooter and discovered the Quad Life variant of the Conway's game of life through this resource.

Metadata

Release files for gh-game-of-life 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gh-game-of-life 0.1.0
File Size Uploaded Provenance Actions
gh_game_of_life-0.1.0.tar.gz 42.1 kB Without provenance Details for gh_game_of_life-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gh-game-of-life 0.1.0
File Interpreter ABI Platform Actions
gh_game_of_life-0.1.0-py3-none-any.whl Python 3 none any Details for gh_game_of_life-0.1.0-py3-none-any.whl

Total release size: 65.8 kB

Release files / gh_game_of_life-0.1.0.tar.gz

Download URL gh_game_of_life-0.1.0.tar.gz
Size 42.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4422e0a39fb76a1bcba9644f3f456de246c42d5848276aa4aba6314d736bf989
BLAKE2b-256 checksum
How to use checksums
86620c7eff0dd9733ffe9326584d776f0956dbb01140aceac44b5e2e63d263c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gh_game_of_life-0.1.0-py3-none-any.whl

Download URL gh_game_of_life-0.1.0-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6331540621a988e0a7a67c240cf5f7caf9dda228e4515ff75093a9c74b174a05
BLAKE2b-256 checksum
How to use checksums
68e0011b35e359fcc872501cfbe9111ce52fc47b1b1abac9e968959b9b7dbb80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for gh-game-of-life 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page