/* automata.h CIS 250 Dave Klick 2015-02-06 This is part of the solution to the 2-D cellular automaton assignment. It is a header file that specifies the interface to a two dimensional cellular automaton. */ #ifndef __AUTOMATA_H__ #define __AUTOMATA_H__ #include using std::ostream; class automata { private: static const char LIVE = '*'; static const char DEAD = ' '; static const int ROWS = 20; static const int COLS= 60; int generation; char grid[ROWS][COLS]; int count[ROWS][COLS]; public: automata(); void reset(); void setCell(const int r, const int col); void clearCell(const int r, const int col); bool isValidCell(const int r, const int c) const; int getLiveNeighbors(const int r, const int c) const; int getGeneration() const; int nextGeneration(); friend ostream& operator<<(ostream& strm, const automata& brd); }; #endif