Source file for a naive implementation of Conway's game of life universe structure.
More...
Source file for a naive implementation of Conway's game of life universe structure.
- Author
- Victor Colomb (vic.c.nosp@m.ol@h.nosp@m.otmai.nosp@m.l.fr)
- Date
- 2021-02-23
◆ naive_universe_get_cell()
char naive_universe_get_cell |
( |
universe |
u, |
|
|
int |
row, |
|
|
int |
column |
|
) |
| |
Get a cell from a universe.
- Parameters
-
- Precondition
row
and column
should be inferior respectively to the height and width of the universe.
- Returns
.
if the cell is dead and 0
if it is alive
◆ naive_universe_update_cell()
void naive_universe_update_cell |
( |
universe |
u, |
|
|
int |
row, |
|
|
int |
column, |
|
|
char |
state |
|
) |
| |
Update a given cell from a universe to a given state.
- Parameters
-
u | universe |
row | |
column | |
state | true for alive, false for dead |
◆ prettyprint_naive_universe()
void prettyprint_naive_universe |
( |
universe |
u | ) |
|
Pretty-prints a universe to the console.
The universe is formatted as follows:
Universe width: {width}
Universe height: {height}
Number of steps: {number of steps}
Universe cells state:
=====================
- Parameters
-
◆ print_naive_cells()
Print a universe's cells state.
- Parameters
-
◆ print_naive_universe()
Print a universe to the console.
The universe is formatted as follows:
{width} {height}
{number of steps}
Array of cells, . representing a dead cell and 0 a live one.
- Parameters
-