Created
November 29, 2017 03:44
-
-
Save kevinsingh5/bcae83677626bd498d69e4b4debc2806 to your computer and use it in GitHub Desktop.
Life design
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
class Life { | |
vector<vector<T>> grid; | |
void read() { | |
} | |
void eval() { | |
} | |
void print() { | |
} | |
} | |
/***************/ | |
class Cell { | |
Abstract Cell *p | |
// contructor takes in pointer to const cell | |
public Cell(const Cell&){ | |
} | |
// constructor takes in ref ref cell | |
public Cell(Cell&&) { | |
} | |
Cell& operator = (const Cell& rhs){ | |
} | |
Cell& operator = (Cell&&) { | |
} | |
// destructor | |
~Shape() { | |
delete p; | |
} | |
void evolve() { | |
} | |
} | |
/***************/ | |
class AbstractCell { | |
bool state; | |
virtual ~AbstractCell() { | |
} | |
virtual AbstractCell* clone() const = 0 { | |
} | |
virtual evolve () = 0 { | |
} | |
} | |
/****************/ | |
class ConwayCell { | |
ConwayCell* clone() const { | |
} | |
evolve () { | |
} | |
} | |
/****************/ | |
class FredkinCell { | |
int age; | |
FredkinCell* clone() const{ | |
} | |
evolve() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment