Conway's Game of Life is a cellular automaton that is played on a 2D square grid. Each square (or "cell") on the grid can be either alive or dead, and they evolve according to the following rules:
- Underpopulation: Any live cell with fewer than two live neighbours dies.
- Overpopulation: Any live cell with more than three live neighbours dies.
- Static: Any live cell with two or three live neighbours lives, unchanged, to the next generation.
- Birth: Any dead cell with exactly three live neighbours comes to life.
The initial configuration of cells can be created by a human, but all generations thereafter are completely determined by the above rules. The goal of the game is to find patterns that evolve in interesting ways – something that people have now been doing for over 50 years.
Proposed implementation uses Python3 to provide a simulation of Conway's Game of Life in Linux terminal
Till this moment only an AUR package is avalaible. In future will be provided packages for more distibutions
yay -S game-of-life-cliClone the repository:
git clone https://github.com/DdimaPos/game-of-life-cli.gitChange into the directory:
cd game-of-life-cliMake the script executable:
chmod +x gol-cli.pyMove the script to a directory in your PATH:
sudo mv gol-cli.py /usr/local/bin/game-of-life-cliEnsure dependencies are installed:
sudo apt-get install python3 python3-numpy # Debian/Ubuntu
sudo dnf install python3 python3-numpy # Fedora
sudo pacman -S python python-numpy # Arch LinuxDelete the directory with the cloned repository
Run CLI script with this command
game-of-life-cliEg: game-of-life-cli -d true or game-of-life-cli --divided false
Eg: game-of-life-cli -t 0.2 or game-of-life-cli --time 0.2
Eg: game-of-life-cli -c cyan or game-of-life-cli --color cyan
Eg: game-of-life-cli -p 0.3 or game-of-life-cli --probability 0.3
You can combine the parameters to get something pleasing to your eyes
In addition there are added some features to let the user enjoy the evolution without involving in process:
- Restarting the simulation when it reaches it's stability - After a certain amount of time 2 generations start to repeat. When this happens simulation restarts
- Wrapping from boundaries - to increse the lifetime of simuation the cells at the boundaries treat as their neighbors cells from opposite boundaries