Giter Site home page Giter Site logo

golife's Introduction

Golife - A Game of Life project

Go Report Card Codacy Badge HitCount PR's Welcome

Simulate John Conway's Game of Life in your terminal. Interface is powered by tcell.

Demo

asciicast

Features

  • Supports the standard Game of Life rules as well as other variations such as HighLife, Amoeba, and others (see rules).
  • It can simulate preset patterns in the RLE, Life 1.06, or Plaintext formats (thanks to life).
  • Supports simulation speed increment of decrement.
  • Supports stepping through the simulation, one generation at a time.
  • Supports themes (limited for now).

Installation

If you have Go installed, you can use the following command to install Golife:

$ go get github.com/ayoisaiah/golife/cmd/...

Alternatively, precompiled binaries are available for Linux, Windows, and macOS here (only for amd64).

Usage

Basic usage:

$ golife

See demo

Preset patterns

RLE, Life 1.06 and Plaintext patterns are supported by Golife. For example, here's a huge list of Game of Life patterns in the RLE format.

You can load a preset pattern from a file (example):

$ golife --file gosperglidergun.cells

See demo

Or you can load a preset pattern from a URL:

$ golife --url "http://copy.sh/life/examples/spider.rle" --input-format rle

See demo

Rules

The default Game of Life rules are as follows:

  • Any live cell with two or three live neighbours survives.
  • Any dead cell with three live neighbours becomes a live cell.
  • All other live cells die in the next generation. Similarly, all other dead cells stay dead.

However, Golife supports other variants as well. You can list them all using the following command:

$ golife rules
Default:
Survives: [2 3], Born: [3]

DayAndNight:
Survives: [3 5 6 7 8], Born: [3 6 7 8]

Coral:
Survives: [4 5 6 7 8], Born: [3]

2x2:
Survives: [1 2 5], Born: [3 6]

34Life:
Survives: [3 4], Born: [3 4]

Amoeba:
Survives: [1 3 5 8], Born: [3 5 7]

Assimilation:
Survives: [4 5 6 7], Born: [3 4 5]
...

Select a rule:

$ golife --rule Amoeba

See demo

Themes

List available themes.

$ golife themes
WhiteOnBlack
BlackOnWhite

Select a theme:

$ golife --theme BlackOnWhite

See demo

Help

$ golife --help

Credits

Golife relies heavily on other open source software listed below:

Contribute

Bug reports, or pull requests are much welcome!

Licence

Created by Ayooluwa Isaiah and released under the terms of the MIT Licence.

golife's People

Contributors

ayoisaiah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

edmt

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.