jankrepl / gameoflife

Minimal python implementation of Game of Life using PyGame for visualization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game of Life using PyGame

Minimal python implementation of Game of Life using PyGame for visualization.

Demo

Usage

  1. Clone
git clone https://github.com/jankrepl/gameoflife.git
cd gameoflife
  1. Create virtual environment
python3 -m venv venv
source venv/bin/activate
  1. Install via setup.py
pip install .
  1. Run via CLI
gol

See below optional arguments

usage: gol [-h] [--width WIDTH] [--height HEIGHT] [--perc PERC]

optional arguments:
  -h, --help       show this help message and exit
  --width WIDTH    Number of cell columns (default: 75)
  --height HEIGHT  Number of cell rows (default: 50)
  --perc PERC      Percentage of cells that are alive at initialization
                   (default: 33)

Controls

  • ⎋ Escape — Exit
  • r — Restart
  • Space — Pause
  • s — Single step (only active in Pause mode)

TODO

  • Better behavior around the borders (currently weird)

References

About

Minimal python implementation of Game of Life using PyGame for visualization

License:MIT License


Languages

Language:Python 100.0%