IN101 project on Conway's Game of Life
|
Source file for a naive implementation of Conway's game of life simulator. More...
#include "naive_conway.h"
Functions | |
int | naive_count_neighbors (universe u, int row, int column, bool consider_torus) |
Count alive neighbors of a cell in a given universe. More... | |
universe | naive_step (universe u, bool consider_torus) |
Get a naive universe's next iteration. Decrements the universe's step_nb parameter by one. More... | |
universe | naive_simulation (universe u, bool print_to_console, bool generate_images, bool consider_torus) |
Get the final state of a universe, according to its step_nb parameter. More... | |
Source file for a naive implementation of Conway's game of life simulator.
int naive_count_neighbors | ( | universe | u, |
int | row, | ||
int | column, | ||
bool | consider_torus | ||
) |
Count alive neighbors of a cell in a given universe.
u | universe |
row | |
column | |
consider_torus | true to consider the universe as a torus |
universe naive_simulation | ( | universe | u, |
bool | print_to_console, | ||
bool | generate_images, | ||
bool | consider_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 |