Crate gol_lib[][src]

Expand description

This crate allow you tu create an play the famous “game of life” of John Conway.
But what is game of life ?
It is an automata invented by John Conway in the 70s.
It is composed of an infinite grid (in practice it is finite), of which cell can be in two state : dead or alive.
The neigbourhood of a cell is the 8 cells which around it (e.g bottom, top, left, right and diagonals).
If an alive cell has two or three neighboors who are alive, it becomes alive. Else, it dies.
If a dead cell has three neighboors who are alive, it becomes alive. Else, it stays dead.
So what you have to do is just create an automata, set some cells (to meke them alive) and to see how it evoluates !
Have fun !

Structs

Class of game of life.
To create a new game of life with a grid of 25 collumns wide and 45 lines height, use :

Functions

Clear the screen

Refresh the screen e.g. show it

Reset every display attributes

Reverse the color of the text which will be write on the screen

Print a caracter at pos x,y

Underline the text which will be write on the screen