Golife - A Game of Life project
Simulate John Conway's Game of Life in your terminal. TUI is powered by tcell.
Note: This project was made as part of the Project52 challenge in order to improve my Go skills.
- 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).
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).
You can load a preset pattern from a file (example):
$ golife --file gosperglidergun.cells
Or you can load a preset pattern from a URL:
$ golife --url "http://copy.sh/life/examples/spider.rle" --input-format rle
The default GoL 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:  DayAndNight: Survives: [3 5 6 7 8], Born: [3 6 7 8] Coral: Survives: [4 5 6 7 8], Born:  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
List available themes.
$ golife themes WhiteOnBlack BlackOnWhite
Select a theme:
$ golife --theme BlackOnWhite
$ golife --help
Golife relies heavily on other open source software listed below:
Bug reports, or pull requests are much welcome!
Created by Ayooluwa Isaiah and released under the terms of the MIT Licence.