Coder Social home page Coder Social logo

gameoflife's Introduction

Game of Life

This is an implementation of Conway's Game of Life made using C++ and SFML.

Instructions

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:

  1. Left Click - place/remove cell, clicking a dead cell will make it a live cell and vice versa
  2. R - clears all live cells off of the grid
  3. Space - start/stop the screen

Game Rules

These are the game rules that I used:

  1. Live cells stay alive if two or three neighbors are alive, otherwise they will die.
  2. Dead cells become alive if three neighbors are alive, otherwise they stay dead.

Installation

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

Some examples

These are some examples of some common patterns in the Game of Life:

  1. Block Block Video
  2. Glider Glider Video
  3. Gosper glider gun Ggg video
  4. Penta-decathlon Penta Video

gameoflife's People

Contributors

peterwzhang avatar

Stargazers

Dalton avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.