Skip to content

SestoAle/Conway-s-Game-of-Life-Cpp

Repository files navigation

Conway's Game of Life

An implementation of Conway's Game of Like in C++ for Human Computer Interaction class.

The implementation follows the Model-View-Controller architectural pattern.

Rules

The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead, (or populated and unpopulated, respectively). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

  • any live cell with fewer than two live neighbors dies, as if by underpopulation;
  • any live cell with two or three live neighbors lives on to the next generation;
  • any live cell with more than three live neighbors dies, as if by overpopulation;
  • any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction. The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick. Each generation is a pure function of the preceding one. The rules continue to be applied repeatedly to create further generations.

Functionalities

You can draw your starting configuration with mouse clicks and save the image to load it at any time later; you can also load some pre-built configurations.

The app provides some extra features:

  • you can zoom out/in from a 10x10 cells map to 200x200;
  • you can speedup time increasing frame rate, starting from 10 fps to 60;
  • you can see the cells lifetime pressing the heatmap toggle.

Requirements

Software Version Required
Qt >= v5.12 Yes

License

Licensed under the term of MIT License.

About

A Conway's Game of Life implementation in C++.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published