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.


The game evolution is determined by simple rules applied on each cells.

  1. Any live cell with fewer than 2 live Neighbors dies. Underpopulation
  2. Any live cell with more than three live neighbours dies Overpopulation
  3. Any dead cell with 3 neighbors respawns Reproduction
  4. Any live cell with 2 or 3 live neighbors lives Normal life


C version

To run it, you’ll need the Raylib library installed. HOW TO

Download, Compile and run the program:

git clone
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

Rust version

git clone 
cd rife
cargo run


/life/life1.gif /life/spawn_glider.gif

Try it

You’ll need to download Cmake for raylib to work

Then just:

git clone 
cd rife
cargo run

Poor performances

Run the profiling:

perf record ./target/release/life
perf report



Lot of Optimizing:

  • double buffering
  • threading computing by line or by chunk.


  • Spawn cells with mouse
  • Spawn shapes
  • Sliders for tweaking setting live


  • Clean up code



Video - Coding Train

Raylib - Graphics Library