Public Methods | |
Life () | |
void | run () |
~Life () | |
Private Methods | |
void | Life::fill () |
void | Life::display () |
void | calculate () |
void | Life::swap () |
Static Private Methods | |
void | Life::wait () |
void | Life::cls () |
Private Attributes | |
LifeMatrix * | fNow |
LifeMatrix * | fFuture |
Definition at line 216 of file LifeExercise.cpp.
|
Definition at line 218 of file LifeExercise.cpp. |
|
Definition at line 233 of file LifeExercise.cpp. |
|
Death if an occupied cell has 0, 1, 4, 5, 6, 7, or 8 occupied neighbours, the organism dies (0, 1 neighbors: of loneliness; 4 thru 8: of overcrowding). Survival if an occupied cell has two or three neighbours, the organism survives to the next generation. Birth If an unoccupied cell has three occupied neighbors, it becomes occupied. Definition at line 261 of file LifeExercise.cpp. References ModN::completed(), SIZE_X, and SIZE_Y. Referenced by run(). |
|
Wrapper for clear screen functionality. Definition at line 298 of file LifeExercise.cpp. |
|
Clears screen and displays the current LifeMatrix on stdout. Definition at line 249 of file LifeExercise.cpp. References LifeMatrix::display(), and fNow. |
|
Fills the LifeMatrix with initial setting. Definition at line 242 of file LifeExercise.cpp. References LifeMatrix::fill(), fNow, and Life::fill(). Referenced by Life::fill(). |
|
Swap future and now. Comparable to double buffering for raster graphics. Definition at line 282 of file LifeExercise.cpp. |
|
Busy wait. Definition at line 291 of file LifeExercise.cpp. |
|
Runs the game. Definition at line 223 of file LifeExercise.cpp. References calculate(), and LifeMatrix::initRand(). Referenced by LifeExercise::execute(). |
|
Definition at line 303 of file LifeExercise.cpp. Referenced by Life(), Life::swap(), and ~Life(). |
|
Definition at line 302 of file LifeExercise.cpp. Referenced by Life(), Life::display(), Life::fill(), Life::swap(), and ~Life(). |