A terminal-based Conway's Game of Life simulator built with Rust and Ratatui. Features cell age visualization, adjustable zoom, pattern placement, and GIF recording.
cargo build --release
cargo run --release
The simulation starts paused on an empty 256x256 grid. Use r to randomize, or toggle the cursor with Tab and draw cells manually with Enter. Use p to insert some design presets.
| Key | Action |
|---|---|
Space |
Pause / resume |
n |
Step one generation |
r |
Randomize grid |
c |
Clear grid |
Tab |
Toggle cursor |
Enter |
Toggle cell at cursor |
h j k l |
Move cursor |
+ / - |
Adjust simulation speed |
[ / ] |
Zoom out / in |
p |
Pattern mode |
1-3 |
Place pattern (in pattern mode) |
g |
Start / stop GIF recording |
Esc |
Cancel pattern mode |
q |
Quit |
In pattern mode (p), the following patterns can be placed at the cursor position:
- Glider
- Pulsar
- Gosper glider gun
Press g to begin recording. Press g again to stop and save. Recordings are capped at 500 frames and auto-save when the limit is reached. Output files are written to the current directory as petri_<timestamp>.gif.
