Skip to content

amurudkar/GOLAnimator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life

This is a simple program that visualizes Conway's Game of Life using OpenCV in C++.

The GOLAnimator class has the ability to detect still lifes and oscillators/blinkers with period up to 5. When these are detected, the main function reduces refresh rate to visualize the condition, then triggers a reset.

Example run

How to build

Prerequisites

Install OpenCV using the official instructions for your platform.

Instructions

  • Clone the project:
    git clone https://github.com/AdX9170/GOLAnimator.git
  • Configure and build:
    cd GOLAnimator
    mkdir build && cd build
    cmake ..
    make
    Note: If you have installed OpenCV to a local directory, you can provide it during the cmake step above. e.g.:
    cmake -DOpenCV_DIR=<path_to_OpenCV_config.cmake> ..

Running

  • Run the executable from the build directory

    <cloned_repo>/build/GOLAnimator[.exe]
  • The GUI provides keyboard controls:

    Key Action
    c change resolution (random)
    i invert colors
    q quit
    r reset to random state
    space pause/resume