# Conway's Game of Life in the terminal The Game of Life, also known as Conway's Game of Life or simply Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. [Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) This script plays a Life simulation in the terminal itself. The game field can either be randomly generated or be generated from an image file. Some example images are included in the repo and can be found in the "sample_images" folder in the project directory. ## Instructions 1. Clone the repository: ``` git clone https://github.com/Koei32/cgol-in-terminal ``` 2. This script requires the PIL module to be installed. Install it with: ``` pip install pillow ``` 3. In the project directory, run an example simulation using: ``` cgol.py -i .\sample_images\pulsar.png -a ``` ## Arguments The program takes the following arguments: - `-r N` : Generates a square random field of size `N`. - `-i path_to_img` : Generates a field from an image specified by `path_to_img`. - `-a` : Presence of **-a** in the command determines whether the simulation steps automatically or requires pressing return. Note: The program *requires* either the `-r` or the `-i` argument. `-a` is an optional switch. ## Demo glidergun
A Gosper's Glider Gun generated from `sample_images/gosperglidergun.png`. random
Randomly generated 16x16 field. ## End This project was made as a practice project for Hack Club's **Summer of Making 2025** ([link](https://summer.hackclub.com/projects/2529)). No line of code or the README was written using AI. The code could use a bit of optimization. Especially I am looking for a fast way to clear the console to reduce flickering at high speeds. If you have any ideas, open an issue! Thanks for viewing. \o