IN101 project on Conway's Game of Life
Classes | Typedefs | Functions
list_universe.h File Reference

Header file for a linked list implementation of Conway's game of life universe structure. More...

#include <stdio.h>
#include <stdbool.h>
#include "linked_list_cell.h"
Include dependency graph for list_universe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  universe
 Structure representing a universe: width, height, number of simulation steps and current cells state. More...
 

Typedefs

typedef struct universe universe
 

Functions

bool list_universe_get_cell (universe u, int row, int column)
 Get a cell's state from a universe. More...
 
void print_list_cells (universe u)
 Print a universe's cells to the console. More...
 
void print_list_universe (universe u)
 Print a universe to the console. More...
 
void prettyprint_list_universe (universe u)
 Pretty-prints a universe to the console. More...
 

Detailed Description

Header file for a linked list 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-03-09

Function Documentation

◆ list_universe_get_cell()

bool list_universe_get_cell ( universe  u,
int  row,
int  column 
)

Get a cell's state from a universe.

Parameters
uuniverse
row
column

◆ prettyprint_list_universe()

void prettyprint_list_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:
=====================
{universe cells}
Parameters
uuniverse

◆ print_list_cells()

void print_list_cells ( universe  u)

Print a universe's cells to the console.

Parameters
uuniverse

◆ print_list_universe()

void print_list_universe ( universe  u)

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
uuniverse