Skip to main content

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.

Python Version License

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

First Steps

  1. Press R to generate random cells
  2. Press P to start the simulation
  3. Press +/- to adjust speed
  4. 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:

  1. Survival: A live cell with 2-3 live neighbors survives
  2. Birth: A dead cell with exactly 3 live neighbors becomes alive
  3. 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
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

License

MIT License - see LICENSE file for details.


Made with Python and Textual

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

game_of_life_tui-1.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

game_of_life_tui-1.1.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file game_of_life_tui-1.1.1.tar.gz.

File metadata

  • Download URL: game_of_life_tui-1.1.1.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

Hashes for game_of_life_tui-1.1.1.tar.gz
Algorithm Hash digest
SHA256 43c1ab023c51fb426383c3ffaa09b40c6210e935d0c266ba4847f8f984c877a9
MD5 64732aa1125f0ec6100a7b891dfcbedf
BLAKE2b-256 222642c9a2ef99813ce51d92e1746c9e3a425a16b427d1335d066c8d3512d929

See more details on using hashes here.

Provenance

The following attestation bundles were made for game_of_life_tui-1.1.1.tar.gz:

Publisher: publish.yml on josephvolmer/game-of-life-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file game_of_life_tui-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for game_of_life_tui-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 424b876f5342a956c974e848571c8cbbbb49cc32c11c0d6adc8a1fbee120b069
MD5 a6202f97339d0220a64e22413f8c0cec
BLAKE2b-256 01d70d84463f11c9ad0adaee9513b874f5e37b0cf5bbbfbc9badc78ab3d52405

See more details on using hashes here.

Provenance

The following attestation bundles were made for game_of_life_tui-1.1.1-py3-none-any.whl:

Publisher: publish.yml on josephvolmer/game-of-life-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page