Skip to content

Latest commit

 

History

History
52 lines (48 loc) · 3.07 KB

README.md

File metadata and controls

52 lines (48 loc) · 3.07 KB

MacOsWorkflow LinuxWorkflow WindowsWorkflow

Game of Life

Visualization of Conway's Game of Life and other life-like cellular automata using SFML.

Base Profile Screenshot 2024 10 21 - 23 24 49 33

About the Game of Life

Conway's Game is a cellular automata invented by the British mathematician John Horton Conway in 1970. It is a zero-player game that evolves based on its initial state. Cells in a grid live, die, or multiply based on the following rules:

  • Any live cell with fewer than two living neighbors dies (underpopulation).
  • Any live cell with two or three living neighbors lives on to the next generation.
  • Any live cell with more than three living neighbors dies (overpopulation).
  • Any dead cell with exactly three living neighbors becomes a living cell (reproduction).

Other Cellular automata are considered Life-like, when they present a similar behaviour to Conway's Game of Life and meet the following criteria:

  • The array of cells of the automaton has two dimensions.
  • Each cell of the automaton has two states.
  • The neighborhood of each cell is the Moore neighborhood.
  • In each time step of the automaton, the new state of a cell can be expressed as a function of the number of adjacent cells that are in the alive state and of the cell's own state. There are in total 2^18 possible life-like rules that can be studied.

Requirements

Features

  • Add/Remove Cells [Mouse Left].
  • Load/Save Patterns [L/S].
    Pattern files are stored in folder /patterns using Run Length Encoded format. Example of pattern files can be found at https://conwaylife.com/wiki.
  • Populate [P].
    Fill the grid with a random pattern of living cells.
  • Rule.
    Set birth/survival rules in Golly/RLE format .
  • Reset [R].
    Reset active pattern to its initial configuration.
  • Clear Grid [G].
  • Set Zoom Level [Mouse Wheel].
  • Drag View [Mouse Right].

Build and Install

  • Clone the repository to your local machine.
    git clone https://github.com/alejandrofsevilla/game-of-life.git
    cd game-of-life
    
  • Build.
    cmake -S . -B build
    cmake --build build
    
  • Portable installation.
    cmake --install build