C application based on Conway's Game of Life. It simulates cellular life based on specific rules.
- Any live cell with fewer than two live neighbours dies, as if by underpopulation.
- Any live cell with two or three live neighbours lives on to the next generation.
- Any live cell with more than three live neighbours dies, as if by overpopulation.
- Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
With these simple four rules, you can create interesting patterns and observe how they evolve over generations. Below is an example:
Cell Simulator uses Raylib for the graphical user interface (GUI).
There are two ways to install Cell Simulator.
- Go to releases page.
- Download
cell_simulator.rar. - Extract
cell_simulator.rar. - Run
life_simulator.exe. - Enjoy.
Note: If Windows Defender flags the downloaded file as a threat, please rest assured it’s a false positive. You can exclude the file temporarily or verify it with VirusTotal. Below is a screen capture of VirusTotal after scanning my own life_simulator.exe.
But if by any means you don't feel comfortable with this executable, proceed to the 2nd option below.
In order to compile Cell Simulator, you need w64devkit with raylib's libraries configured. If you don't already have these, follow the steps below.
- Install w64devkit.
- Download
raylib-x.x_win64_mingw-w64.zipfrom https://github.com/raysan5/raylib/releases. - Extract
raylib-x.x_win64_mingw-w64.zip. - Copy the
includeandlibfolders intoC:\w64devkit\x86_64-w64-mingw32 - Run
w64devkit.exefromC:\w64devkit\
Compilation steps using w64devkit
- Clone this repository:
git clone https://github.com/ulises-justo-saucedo/cell-simulator
- Navigate to
cell-simulator/srcfolder and compile it usinggcc:
cd cell-simulator/src
gcc main.c life_simulator.c -lraylib -lgdi32 -lwinmm -o life_simulator
-lwinmm flag since I'm in Windows Operative System.
- Real time simulation of cellular life.
- Keys for pausing, restarting and randomizing simulation.
- Mouse interactions for manipulating cells directly.
Spacebar: Pauses simulation.
Ckey: Clears the simulation by killing all cells.
Rkey: Randomices the entire board.
Mouse left button: Kills or spawns a single hovered cell.
Mouse right button: Kills or spawns multiple hovered cells by dragging mouse.






