An interactive Conway's Game of Life implementation using Clojure and Quil with support for RLE file loading, pattern centering, and real-time interaction.
- Visual simulation with animated colored cells
- RLE file support including patterns with repeated line ends
- Pattern centering option to center loaded patterns on the screen
- Interactive controls:
- Spacebar: Pause/unpause the simulation
- Mouse click: Toggle cell liveness at clicked location
- Mouse drag: Paint/erase cells while dragging
- Configurable parameters: Board size, cell step size, and frame rate
- Higher-order coloring functions for customizable cell appearance
Run the game with default settings:
clj -M:run
Run with custom options:
clj -M:run --size 100 --step 10 --fps 5
Run with an RLE file:
clj -M:run --file glider.rle
Run with a centered pattern:
clj -M:run --file gosper-gun.rle --center
--size SIZE
: Board size in number of cells (default: 50)--step STEP
: Cell size in pixels (default: 50)--fps FPS
: Frames per second (default: 1)--file PATH
: Load an RLE pattern file--center
: Center the loaded pattern on the screen
- Spacebar: Pause or resume the simulation
- Left click: Toggle a cell between alive and dead
- Click and drag: Paint/erase multiple cells by dragging
This implementation supports the Run Length Encoded (RLE) format commonly used for Conway's Game of Life patterns:
- Basic patterns:
bo$2bo$3o!
(glider) - Repeated elements:
3o
(3 alive cells),5b
(5 dead cells) - Line endings:
$
(newline),2$
(skip 2 lines) - Comments: Lines starting with
#
- Metadata:
x = 3, y = 3, rule = B3/S23
Run tests:
clj -M:test
Build an uberjar:
clj -T:build uber
- Java 11 or higher
- Clojure CLI tools