Conway's Game of Life in Zig.
game-of-life-demo.webm
Made in a couple pairing sessions at Recurse Center.
Supports Windows and MacOS. If using MacOS, make sure SDL2 is installed in your /Library/Frameworks
path.
zig build
zig-out/bin/zgol.exe <args>
# Alternatively you can just use the run step
zig build run -- <args>
Try loading an example with
zgol -load=examples/<filename>
Because the grid is represented as a binary array, you can load any arbitrary data! Try loading the executable with
zgol -load=zgol.exe
Use -help
to see CLI commands.
Input | Action |
---|---|
Left Click | Fill Cell |
Right Click | Erase Cell |
Space | Toggle Simulation |
+ |
Increase Update Speed |
- |
Decrease Update Speed |
R |
Reload file (if any) |
S |
Save file |
Saving will always create a new file in <exe-directory>/saves
, named by the current timestamp. Reloading will attempt to load the latest save or the inital -load
file.