IN101 project on Conway's Game of Life
|
Header file for an expandable linked list implementation of Conway's game of life simulation. More...
Go to the source code of this file.
Functions | |
linked_list | list_neighbors_expandable (universe u, int row, int column) |
Get a list of a cell's neighbors in a universe. More... | |
int | list_count_neighbors_expandable (universe u, int row, int column) |
Count alive neighbors of a cell in a given universe. More... | |
universe | recenter_universe (universe u) |
Recenter a universe (move to all positive, increase height and width if needed) More... | |
universe | list_step_expandable (universe u) |
Get a naive universe's next iteration. Decrements the universe's step_nb parameter by one. More... | |
universe | list_simulation_expandable (universe u, bool print_to_console, bool generate_images) |
Get the final state of a universe, according to its step_nb parameter. More... | |
Header file for an expandable linked list implementation of Conway's game of life simulation.
int list_count_neighbors_expandable | ( | universe | u, |
int | row, | ||
int | column | ||
) |
Count alive neighbors of a cell in a given universe.
u | universe |
row | |
column | |
consider_torus | true to consider the universe as a torus |
linked_list list_neighbors_expandable | ( | universe | u, |
int | row, | ||
int | column | ||
) |
Get a list of a cell's neighbors in a universe.
u | universe |
row | |
column | |
consider_torus | true to consider the universe as a torus |
Get the final state of a universe, according to its step_nb
parameter.
u | universe |
print_to_console | true to print each step to the console |
generate_images | true to generate images |
consider_torus | true to consider the universe as a torus |
Get a naive universe's next iteration.
Decrements the universe's step_nb
parameter by one.
u | universe |
consider_torus | true to consider the universe as a torus |