Git Product home page Git Product logo

conways-game-of-life's Introduction

John Conway's Game of Life

This project is an implementation of the Game of Life automaton. The interface was built using ReactJS and the core game rules were implemented using an object oriented approach with TypeScript.

To try it out visit here, generate a random grid, or draw one out yourself and start the simulation to see the game running.

Rules

The simulation runs based on very simple rules:

  • It is given a grid of indefinite dimensions (this is achieved in this project by wrapping the grid around so that the ends always meet);

  • Each cell in the grid can either be dead or alive and has 8 (eight) neighbors, which are all the cells adjacent it in any direction;

  • Given an initial state for the grid cells, the simulation can start and the cells will update themselves based on a set of rules. For a given generation, the next one is determined by these rules:

    • If a cell is not alive and has exactly 3 live neighbors, it becomes alive, otherwise it stays as is;

    • If a cell is alive and has 2 or 3 live neighbors, it survives. In other words, it's state doesn't change and it stays alive;

    • If a cell is alive and has less than 2 live neighbors, it dies due to isolation;

    • If a cell is alive and has more than 3 live neighbors, it dies due to overpopulation.

Based on these simple rules, a very complicated system can be created for which there is no mathematical way of proving wether it will go on forever or end completely in 100 or 1000 generations.

Inspiration

Inspired by this video I watched a few years ago where Conway explains how he came up with the game and what is it's mathematical purpose, I thought it would be a cool thing to program an implementation myself.

conways-game-of-life's People

Contributors

jgabriel1 avatar

Watchers

 avatar  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.