#ifndef _BOARD_H_ #define _BOARD_H_ #include using namespace std ; class Cell { friend class LifeBoard ; public: // Cell() ; // just use default constructor private: vector neighbors ; bool alive ; bool aliveNext ; bool isAlive() ; void setAlive(bool state=false) ; void setNeighbors(vector list) ; void update() ; void willSurvive() ; } ; class LifeBoard { public: LifeBoard(unsigned int r, unsigned int c, bool *b = NULL) ; void setPattern(unsigned int r, unsigned int c, bool *b) ; void update() ; void display(ostream& os = cout) ; void run(unsigned int steps = 500, unsigned int delay=200) ; void batchRun(unsigned int steps = 500) ; private: vector cells ; unsigned int rows ; unsigned int cols ; unsigned int pos(unsigned int r, unsigned int c) ; } ; #endif