Public Methods | |
void | display () const |
int | countNeighbours (const ModN &x, const ModN &y) const |
void | fill () |
void | kill (const ModN &i, const ModN &j) |
void | enliven (const ModN &x, const ModN &y) |
bool | isAlive (const ModN &x, const ModN &y) const |
Static Public Methods | |
void | initRand () |
Private Methods | |
char | fillRand (int x, int y) |
char | fillSquare58 (int x, int y) |
char | fillLine (int x, int y) |
char | fillGlider (int x, int y) |
Private Attributes | |
lifeMatrix_t | fMatrix |
Definition at line 85 of file LifeExercise.cpp.
|
Counts the neighbours of the cell given by x and y.
Definition at line 108 of file LifeExercise.cpp. References isAlive(). |
|
Displays the LifeMatrix on stdout. Definition at line 90 of file LifeExercise.cpp. References fMatrix, SIZE_X, and SIZE_Y. Referenced by Life::Life::display(). |
|
Enlivens the element at the given corodinates.
Definition at line 151 of file LifeExercise.cpp. |
|
Fills the LifeMatrix with a certain pattern. You can choose between fillRand, fillSquare58, fillLine, fillGlider Definition at line 129 of file LifeExercise.cpp. References fillGlider(), fMatrix, SIZE_X, and SIZE_Y. Referenced by Life::Life::fill(). |
|
Fills the LifeMatrix with the Glider pattern. Definition at line 199 of file LifeExercise.cpp. Referenced by fill(). |
|
Fills the LifeMatrix with a line pattern. Definition at line 192 of file LifeExercise.cpp. |
|
Fills the LifeMatrix with a random pattern. Definition at line 178 of file LifeExercise.cpp. |
|
Fills the LifeMatrix with a square pattern. Definition at line 185 of file LifeExercise.cpp. |
|
Seeds the random number generator. Definition at line 167 of file LifeExercise.cpp. Referenced by Life::run(). |
|
Indicates whether the element at the given corodinates is alive.
Definition at line 160 of file LifeExercise.cpp. References ALIVE, and fMatrix. Referenced by countNeighbours(). |
|
Kills the element at the given corodinates.
Definition at line 142 of file LifeExercise.cpp. |
|
Definition at line 209 of file LifeExercise.cpp. Referenced by display(), enliven(), fill(), isAlive(), and kill(). |