Conway's Game of Life in your terminal with an interactive TUI
Project description
Game of Life TUI
A beautiful, interactive terminal-based implementation of Conway's Game of Life built with Python and Textual.
Features
- Vibrant Rainbow Colors - Cells cycle through cyan→green→yellow→magenta→blue as they age
- Zero Dependencies - 100% pure Python, installs with a single pip command
- Interactive TUI - Beautiful terminal interface optimized for 80x24 screens
- Theme Support - Switch between multiple themes with Ctrl+\
- Preset Patterns - Spawn gliders, blinkers, and other classic patterns (keys 1-5)
- Save/Load - Persist your creations to JSON files
- Cross-Platform - Works on macOS, Linux, and Windows
Installation
pip install game-of-life-tui
Quick Start
After installation, run:
game-of-life-tui
First Steps
- Press
Rto generate random cells - Press
Pto start the simulation - Press
+/-to adjust speed - Press
Ctrl+\to change themes
Controls
| Key | Action |
|---|---|
P |
Play/Pause simulation |
S |
Step one generation (when paused) |
Space |
Toggle cell at cursor |
Arrow Keys |
Move cursor |
R |
Fill with random cells |
C |
Clear all cells |
1-5 |
Spawn preset patterns |
+ / - |
Adjust speed |
Ctrl+\ |
Change theme |
Ctrl+S |
Save grid |
Ctrl+L |
Load grid |
Q or Esc |
Quit |
Cell Colors (Meaningful Rainbow)
- Cyan (Age 1) - Newborn cells
- Green (Age 2) - Young cells
- Yellow (Age 3) - Mature cells
- Magenta (Age 4) - Old cells
- Blue (Age 5+) - Ancient survivors
Watch as patterns evolve and cells age through the rainbow spectrum!
Game Rules
Conway's Game of Life follows these simple rules:
- Survival: A live cell with 2-3 live neighbors survives
- Birth: A dead cell with exactly 3 live neighbors becomes alive
- Death: All other cells die or remain dead
The grid wraps around edges (toroidal topology) for seamless gameplay.
Examples
Spawn a Glider
1. Run game-of-life-tui
2. Press 1 to place a glider
3. Press P to watch it travel
Create Custom Patterns
1. Press P to pause
2. Use arrow keys to navigate
3. Press Space to toggle cells
4. Press P to run your creation
Experiment with Chaos
1. Press R for random cells
2. Press P to start
3. Watch patterns emerge!
Requirements
- Python 3.8 or higher
- textual >= 0.47.0 (automatically installed)
No system dependencies required!
Links
- GitHub: https://github.com/josephvolmer/game-of-life-tui
- Issues: https://github.com/josephvolmer/game-of-life-tui/issues
License
MIT License - see LICENSE file for details.
Made with Python and Textual
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file game_of_life_tui-1.2.0.tar.gz.
File metadata
- Download URL: game_of_life_tui-1.2.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae3fca100e376d4e7565beb6a8f8f2305b65a7c04df232881a9a15abc4d7b28a
|
|
| MD5 |
5ad7c92d84fedd74e2df9a4b809e355c
|
|
| BLAKE2b-256 |
0330d9a94d22a9378348a08dce8173b6c64ed958662b2d5158e6b400d785c891
|
Provenance
The following attestation bundles were made for game_of_life_tui-1.2.0.tar.gz:
Publisher:
publish.yml on josephvolmer/game-of-life-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
game_of_life_tui-1.2.0.tar.gz -
Subject digest:
ae3fca100e376d4e7565beb6a8f8f2305b65a7c04df232881a9a15abc4d7b28a - Sigstore transparency entry: 835691455
- Sigstore integration time:
-
Permalink:
josephvolmer/game-of-life-tui@128e0aa3379f45b00614b1c48807b8e01c3ca861 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/josephvolmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@128e0aa3379f45b00614b1c48807b8e01c3ca861 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file game_of_life_tui-1.2.0-py3-none-any.whl.
File metadata
- Download URL: game_of_life_tui-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a14555392025deb55f705482107358650c1735ed4bcddeeb3b46861c47d5541
|
|
| MD5 |
cb020ab23e591ae734724bd6d77237b6
|
|
| BLAKE2b-256 |
31b93a0dbcedf9d0c460bd688261cebae2baeb86fd0fed15c7fb084513d4fd47
|
Provenance
The following attestation bundles were made for game_of_life_tui-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on josephvolmer/game-of-life-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
game_of_life_tui-1.2.0-py3-none-any.whl -
Subject digest:
7a14555392025deb55f705482107358650c1735ed4bcddeeb3b46861c47d5541 - Sigstore transparency entry: 835691462
- Sigstore integration time:
-
Permalink:
josephvolmer/game-of-life-tui@128e0aa3379f45b00614b1c48807b8e01c3ca861 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/josephvolmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@128e0aa3379f45b00614b1c48807b8e01c3ca861 -
Trigger Event:
workflow_dispatch
-
Statement type: