#ifndef LIFEH #define LIFEH #include //defines size_t using namespace std; const size_t life_ymax = 10; const size_t life_xmax = 10; typedef bool life_matrix_t[life_ymax][life_xmax]; typedef bool _life_matrix_t[life_ymax + 2][life_xmax + 2]; class set_life_foreground { const char c; public: set_life_foreground(char initial_c): c(initial_c) {} friend ostream& operator<<(ostream& ost, const set_life_foreground& f); }; class life { static const int subscript; //subscript of new element in iword array int g; //generation number _life_matrix_t matrix; public: life(const life_matrix_t initial_matrix); int generation() const {return g;} life& operator++(); friend ostream& operator<<(ostream& ost, const life& li); friend ostream& operator<<(ostream& ost, const set_life_foreground& f); }; #endif