Or… CCGL.
This is the Conway’s Game of Life, a cellular automaton, coded in C.
This supports Windows and Unix-like (Linux and MacOS1).
The following compiler command is going to place the executable on bin folder.
Requirements:
libncurses(Ubuntu/Debian).ncurses-devel(Fedora/RHEL).- GCC/Clang.
Ensure the requirements are installed.
# Ubuntu/Debian
sudo apt install libncurses-dev# Fedora/RHEL
sudo dnf install ncurses-develFor compiling, you can use GCC or Clang. For GCC:
gcc main.c includes/*.c -lncurses -o bin/mainFor Clang:
clang main.c includes/*.c -lncurses -o bin/mainEnsure the executable has permission to run:
chmod +x bin/mainRequirements:
ncurses.- GCC.
Ensure the requirements are installed.
brew install ncursesTo compile, use GCC:
gcc main.c includes/*.c -I/usr/local/opt/ncurses/include -L/usr/local/opt/ncurses/lib -lncurses -o bin/mainRequirements:
Compiling:
gcc main.c includes\*.c -o bin\main.exe<bin> <height> <width> [<fullness>]
<bin>— Replace with your binary file.- On Linux/macOS the default is
bin/main - On Windows the default is
bin\main.exe
- On Linux/macOS the default is
<height> <width>— Height and width of the board.<fullness>(optional) — The fullness percentage of active cells (integer from 0 to 100).- 0 means empty.
- 100 means full.
Footnotes
-
MacOS not tested, tester needed! ↩