This is an implementation of Conway's Game of Life made using C++ and SFML.
By default dead cells are colored black and live cells are colored white.
Right now there are only three controls which you can find listed below:
- Left Click - place/remove cell, clicking a dead cell will make it a live cell and vice versa
- R - clears all live cells off of the grid
- Space - start/stop the screen
These are the game rules that I used:
- Live cells stay alive if two or three neighbors are alive, otherwise they will die.
- Dead cells become alive if three neighbors are alive, otherwise they stay dead.
You can follow these steps to install:
Setup vcpkg:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install sfml
./vcpkg integrate install
Build with CMake (make sure to update your toolchain file):
git clone
cd GameOfLife
mkdir build
cmake -B build/ -S . -DCMAKE_TOOLCHAIN_FILE=PUT PATH TO : vcpkg.cmake
cd build
cmake --build .
./GameOfLife
These are some examples of some common patterns in the Game of Life: