Conway's Game of Life in Terminal!
-
play/pause
-
4 level speed adjustment.
-
Saving curent pattern to a text file.
-
Loading a patten from a text file.
-
Live edit mode.
- install git & c/c++ compiler
$ sudo apt install git build-essential
- install ncurses
$ sudo apt install libncurses5-dev libncursesw5-dev
- clone the repo
$ git clone https://github.com/saurabhsingh99100/game-of-life.git
- cd to the cloned repo & compile the program using the povided shell script
$ cd game-of-life
$ ./compile.sh
Note: You may first need to make compile script executable, this can be done by:
$ chmod +x compile.sh
-
play/pause at any time using the
p
key. -
quit at any time using
q
key orctl+c
. -
Use
1
,2
,3
,4
keys to adjust speed in an inceasing fashion. -
To save currently displayed pattern, press
s
key. Then enter a filename in the prompt that will appear on the top of the scrreen & pressenter
. (Use-
key for backspace). -
To load a pattern from a file, invoke the program with filename as a command line argument. ex
$ ./gol patterns/glider_gun
. -
To edit the current pattern:
-
pause the simulation (using
p
key) & a cursor will appear (marked by symbolO
). -
You can move the cursor up, down, left, and right using
i
,k
,j
,l
keys respectively. -
To toggle the state of a cell (from alive to dead or vice-versa), move the cursor to that cell and use
space
key.
-
Have Fun!