A terminal implementation of Conway's Game of Life written in Go. This cellular automaton transforms your terminal into a dynamic playground for exploring various patterns and behaviors.
- Multiple Patterns: Choose from predefined patterns like blinker, toad, beacon, glider, and more
- Customizable Colors: Configure cell and background colors through JSON configuration
- Flexible Settings: Adjust FPS and other behaviors via config file or command-line arguments
- Interactive Controls: Pause, resume, and step through generations manually
- Go 1.21 or later
git clone https://github.com/dmcg310/game-of-life.git
cd game-of-life
make installmake build# Run with default settings
make run
# Run with specific pattern and FPS
make run-pattern PATTERN=glider FPS=30
# Or use the binary directly
./bin/game-of-life [pattern] [fps]# Show available patterns
make patterns
# Show configuration directory
make config-location
# Show help
make help- p: Pause/resume the simulation
- Space: Step through one generation when paused
- q/Esc/Ctrl+C: Quit the program
The program looks for gol-config.json in the current directory or your system's config directory:
{
"preset": "random",
"cell-color": "white",
"background-color": "black",
"fps": 23
}blinker,toad,beacon,lwss,gosper-glider-gun,glider,block,random
black,maroon,green,olive,navy,purple,teal,silvergray,red,lime,yellow,blue,fuchsia,aqua,white
make all # Clean, format, vet, and build
make build # Build the application
make dev-build # Build with race detection
make clean # Clean build artifactsmake fmt # Format code
make vet # Vet code
make tidy # Tidy dependenciesmake build-all # Build for Linux, Windows, and macOS
make release # Create release archivesgame-of-life/
├── cmd/ # Application entry point
├── internal/
│ ├── cli/ # Command-line interface
│ ├── config/ # Configuration management
│ ├── display/ # Terminal display handling
│ ├── errors/ # Error handling
│ └── game/ # Core game logic and grid
├── Makefile # Build automation
└── gol-config.json # Default configuration
- Conway's Game of Life - Original concept
- tcell - Terminal interface library
- cli - Command-line interface framework
