Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Conway's Game of Life

GameOfLifeCpp is a C++20 implementation of Conway's Game of Life with SDL2 visualization.

The simulation logic is separated from the application and rendering code. The grid is stored as a contiguous one-dimensional array and can be edited interactively while the simulation is paused.

Runtime parameters such as window size, cell size and update interval can be changed from the command line. A benchmark mode runs the simulation without initializing SDL and measures a single update.

Build

SDL2 must be available to CMake. The project downloads cxxopts automatically.

cmake -S . -B build
cmake --build build --config Release

Usage

GameOfLife --width 800 --height 600 --cell 10 --speed 100

Press Space to pause or resume, Esc to exit, and click cells while paused to change their state.

Benchmark example:

GameOfLife --width 1920 --height 1080 --cell 1 --benchmark --benchmark-mode=random

About

My game of life C++ and SDL2 implementation

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages