| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
std::vector<std::vector<bool>> cellAutom_2D ( ... )std::vector<std::vector> cellAutom_2D (std::vector<std::vector> input, int ruleset)
Return a two dimensional boolean standard vector according to an input vector representing CA previous state and a 18 bit int encoded ruleset.
Example.
std::vector<std::vector<bool>> ca = {
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,1,1,1,1,1,1,1,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0}
};
autom.clear();
code = ofRandom(262144);
for (int i = 0;i < NUM_ITERATIONS; i++) {
ca = cellAutom_2D(ca,code);
autom.push_back(ca);
}Two-Dimensional Cellular Automata
A new kind of science - Cellular Automata
3D generated graphics using Cellular Automata
| Back | FazBrowse Home | New Git URL |