Home

Awesome

Conway's Game of Life (Terminal Screensaver)

conway

This project is an enhanced implementation of Conway's Game of Life, a cellular automaton simulation, using the ncurses library in C. It now includes a configuration file system for easy customization.

Features

Requirements

Usage

To compile and run the program, execute the following commands:

git clone https://github.com/cdkw2/conway-screensaver
cd conway-screensaver/
make
./conway-screensaver
sudo make install    # To install it.
make install-config    # To install the config file in to your ~/.config/conway-screensaver/
Arch Linux (AUR)
yay -S conway-screensaver

Void Linux (XBPS-SRC)

Assuming you have void-packages.

git clone https://github.com/elbachir-one/void-templates
cp -r void-templates/conway-screensaver void-packages/srcpkgs/   # Copying the gols directory that has the template.
cd void-packages/
./xbps-src pkg conway-screensaver    # To build conway-screensaver
sudo xbps-install -R hostdir/binpkgs conway-screensaver    # Installing conway-screensaver

The simulation will start automatically. Press 'q' to quit the program, or 'r' to reset the grid. Make a alias on your .bashrc or whatever file to run it anywhere.

Configuration

The program uses a configuration file named game_of_life.conf, which is located in ~/.config/conway-screensaver/ after installation. Below is an explanation of each configuration variable:

Example game_of_life.conf:

infinite_mode=1
update_interval=100000
cell_char=#
max_age=8
color_mode=1
glider_interval=5
initial_density=0.3
wrap_edges=1

Infinite Mode

In infinite mode, the simulation continuously introduces glider patterns at specified intervals, preventing the grid from reaching a static state and ensuring ongoing activity.

Future Ideas

This project offers a fun and interactive way to explore cellular automata through a terminal interface, making it not just a screensaver but also a tool for learning about complex systems.

Version 1.0.2