Git Product home page Git Product logo

game-of-life's Introduction

Conway's Game of Life

English 简体中文

Probably one of the most fantastic but pratical demo of Conway's Game of Life, based on Javascript, Canvas and dat.GUI.

DEMO

Warning: This DEMO is only available out of Mainland China, if you are currently in Mainland China, please refer to Chinese README.

Description

Conway's Game of Life is a computer game based on a kind of Cellular Automatons invented by the British mathematician John Horton Conway in 1970, and proved Turing complete. It originally appeared in Martin Gordon's "Math Game" column in Scientific American in October 1970. The principle is very simple, that is, there are several cells living on a two-dimensional plane, and its surviving or not at the next moment depends on the existence of cells in the surrounding 8 grids. The specific rules are as follows:

  • If 2 cells surrounded, keep the latest status.
  • If 3 cells surrounded, the cell comes to live (or keep alive).
  • If equals to or less than 1 cell or equals to or more than 4 cells, it dies.

The plane is theoretically infinity, but due to the device restrictions, it can only be large as possible. This repo is a Web program of Conway's Game of Life, based on pure Canvas and dat.GUI.

Instructions

  • Not interested in configurate the repo manually, you can straighly open the online DEMO.
  1. Modify the parameters beginning with const in script.js.
  2. Run index.html, adjust on the panel top-right.
  3. Choose a pattern and place it on the map.

Customized Collection HOW TO

Collection is a collection of patterns, which can be loaded when starting this game and placed on the map.

You can follow the instructions in collection.js to create your own Collection, and insert it in index.html following its guide and modified parameter collection in script.js.

You can also follow the instructions in translator.py, create your own Plaintext files(.cells) and use translator.py to transfer it to Collection script.

Please don't try opening all.js, it might be too large for your device to handle.

Contribution

  1. Fork the repository
  2. Create feature/xxx branch
  3. Commit your code
  4. Create Pull Request

game-of-life's People

Watchers

James Cloos 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.