Repos
Game of life
This is a simple implementation of John Conway’s Game Of Life! It’s made in C and it’s using the great Raylib graphics library. The game is a cellular automaton which roughly means that we create some cells and let them evolve by simply following some rules.
Rules
The game evolution is determined by simple rules applied on each cells.
- Any live cell with fewer than 2 live Neighbors dies. Underpopulation
- Any live cell with more than three live neighbours dies Overpopulation
- Any dead cell with 3 neighbors respawns Reproduction
- Any live cell with 2 or 3 live neighbors lives Normal life
Demos
C version
To run it, you’ll need the Raylib library installed. HOW TO
Download, Compile and run the program:
git clone git@github.com:ThePurpleOne/life.git
make run
Random game
Fun patern that appeared (a lot more on the wikipedia page)
Go 3D version
Download, Compile and run the program:
git clone git@github.com:ThePurpleOne/3d_life.git
Rust version
git clone git@github.com:ThePurpleOne/rife.git
cd rife
cargo run
Demo
Try it
You’ll need to download Cmake https://cmake.org/download/ for raylib to work
Then just:
git clone git@github.com:ThePurpleOne/rife.git
cd rife
cargo run
Poor performances
Run the profiling:
perf record ./target/release/life
perf report
Todos
Lot of Optimizing:
- double buffering
- threading computing by line or by chunk.
Features:
- Spawn cells with mouse
- Spawn shapes
- Sliders for tweaking setting live
Clean:
- Clean up code