GithubHelp home page GithubHelp logo

gameoflife's Introduction

Game of Life

The Game of Life is a cellular automaton devised by John Conway in 1970.

This game is (notably) an interesting illustration of how simple rules can lead to the creation of complex entities.

Two versions are implemented in this Java version:

  • Game 2D: the original Game of Life by John Conway, in two dimensions.
  • Game 1D: a one-dimensional version of the Game of Life, by Stephen Wolfram. The type of game may be changed in the Game menu.

Game 2D

The rules are the following :

  • Any live cell with fewer than two live neighbours dies, as if by underpopulation.
  • Any live cell with two or three live neighbours lives on to the next generation.
  • Any live cell with more than three live neighbours dies, as if by overpopulation.
  • Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

Some configurations are implemented in Config > Configurations2D. They are written in RLE format.

Screenshot

Game 1D

In this one-dimensional Game of Life (an elementary cellular automaton), each cell can have two possible values (0 or 1), and rules depend on nearest neighbor values. This game is based on a three-cell neighborhood, YXY, where the next generation of the center cell X depends on its own state and those of the two Y cells.

Since there are 2ร—2ร—2=2^3=8 possible binary states for the three cells neighboring a given cell, there are a total of 2^8=256 elementary cellular automata, each of which can be indexed with an 8-bit binary number.

A few rules are implemented by default in Config > Rules 1D. A Random rule may also be generated in this menu. The current rule is displayed in the Rule text field.

Screenshot

Install

Requirements

On Windows

  1. JDK

    This program requires Java. It can be downloaded here

On Debian

  1. JDK

    This program requires Java Development Kit. Install with

sudo apt install default-jdk

Usage

To launch the gui on Debian, type

./editor.sh

On Windows, launch the executable

build.bat

Step advances one step of evolution, displayed in the Step text field.

Random generates a random configuration, giving a random value to each cell.

Play continues evolution automatically. Playing speed can be accelerated or decelerated through + or - buttons.

Reset goes back to starting configuration.

The Game menu allows to change between Game 1D and Game 2D. The Config menu allows to:

  • Choose implemented configurations for Game 2D
  • Change the evolution rule for Game 1D

gameoflife's People

Contributors

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