Conway is a terminal implementation of Conway's Game of Life ("GoL") that uses the contents of arbitrary files as the initial state.
conway README.md
Each byte is expanded into eight bits, with each bit corresponding to a cell in the initial grid. The simulation then evolves according to the standard GoL rules.
file -> bytes -> bits -> cell -> generations
Install directly from the repo
cargo install --git https://github.com/punctuations/conway
Or build locally
git clone https://github.com/punctuations/conway
cd conway
cargo build --release
# Install to PATH
cargo install --path .
conway <file>
Any file can be used as input
conway README.mdconway image.pngconway /usr/bin/lswhich ls | conwaycat "Hello world!" | conway
The initial state is deterministic.
The input file is read as raw byte stream and converted to a bit stream.
For example: 0xA6 -> 10100110
The bit stream is mapped row-major onto the simulation grid. Then grid is then updated using Conway's GoL rules.
The terminal size determines the visible portion of the grid.