go-llca is a life-like cellular automaton simulation tool written in Go. It is built to allow easy experimentation with different automaton rules while being very performant: go-llca is multithreaded and can smoothly simulate boards with millions of cells.
go-llca also makes it possible to export crisp GIFs of the performed simulations.
The most famous example of an LLCA is Conway's Game of Life: a 2D grid of cells, each of which is either dead or alive. The grid is repeatedly updated based on very simple rules:
- Any dead cell with exactly 3 live neighbors becomes a live cell (birth rule).
- Any live cell with exactly 2 or 3 live neighbors survives (survival rule).
- All other live cells die in the next generation. Similarly, all other dead cells stay dead.
Life-like cellular automata are just like that, except we allow different birth and survival rules. For example, we may have an LLCA where a live cell is born from any dead cell which has 2, 3, 4, or 7 live neighbors, and any live cell survives if it has 3 or 5 live neighbors. We can then concisely write this rule as B2347/S35.
These sorts of simple rules, when iterated many times, can give rise to surprisingly complex patterns. Examples generated using go-llca are shown in the gallery below.
To clone and build (requires Go 1.18 or newer):
$ git clone https://github.com/fplonka/go-llca.git
$ cd go-llca
$ go build .
Then run with:
$ ./go-llca
WARNING: Some of the following animations contain rapidly flashing lights.
B3/S23 (Conway's Game of Life):
B34/S2678:
B4678/S35678:
B45678/S2345:
B2/S678:
B23/S1:
B34/S234567:
B378/S245678:
B3578/S24678: