Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

simple C++ function to generate 2D Cellular Automata representation in one std::vector<std::vector<bool>>

Notifications You must be signed in to change notification settings

unexCoder/2D-Cellular-Automata

Open more actions menu

Repository files navigation

2D-Cellular-Automata

Simple C++ function to generate 2D Cellular Automata representation in one std::vector<std::vector>

Usage

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);
}

About Cellular Automata

Two-Dimensional Cellular Automata

A new kind of science - Cellular Automata

Screenshots

3D generated graphics using Cellular Automata

--

--

--

About

simple C++ function to generate 2D Cellular Automata representation in one std::vector<std::vector<bool>>

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.