PanagiotisPtr / gameoflife

A c and ncurses build of game of life

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game of life

This is a simulator of Conway's game of life written in C and using ncurses for the interface.

Example screen:

Iteration: 0
--------------------
--------------------
--------------------
--------------------
--------------------
----------##--------
---------##---------
---------#-#--------
------------#-------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------

How to use

Startup

When compiled, you can run in two different ways:

  • With no arguments given, it is arranged to fit the screen.
  • If two numerical arguments are given, they are assigned as their height and width respectively.

Usage

Live cells are marked as a '#' whereas dead cells are marked as a '-'.

You can toggle a cell between these two states by clicking on it.

To run an iteration of the simulation press the 'n' key.

To quit press the 'q' key.

To do

  • Add a clear key to the simulation
  • Make the grid dynamically resizable on startup
  • Make the grid fit the terminal size

About

A c and ncurses build of game of life


Languages

Language:C 100.0%