Git Product home page Git Product logo

game-of-life's Introduction

Game of Life

https://gyazo.com/81549935070746bc19ada81610b7643d

Introduction

This program simulates Conway's Game of Life. It was made using Processing 3.

In 1970, John Horton Conway created a cellular automaton, called the Game of Life. Although being named a game, there is no player that controls the game, except possibly for the cells which are initially alive/dead.

Rules

Each cell in the grid can either be alive or dead.

Any live cell with 2 or 3 live neighbouring cells will stay alive. If a live cell has less than 2 neighbouring cells, it will die, as if by underpopulation. If a live cell has more than 3 neighbouring cells, it will die, as if by overpopulation.

Any dead cell with exactly 3 live neighbouring cells will become alive, as if by reproduction.

Instructions

Click on a grid cell to set it to alive/dead state. Press the S key to start/pause the simulation. Press the R key to clear the grid.

Patterns

Even though the rules to the game are simple, there is a plethora of patterns that can be formed. A list of the patterns can be found here: https://en.wikipedia.org/wiki/Category:Cellular_automaton_patterns

Further Improvements and Modifications

The current algorithm to check whether a cell should be alive or dead in the next generation could be made more efficient (i.e. less iterations of the for loop).

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.