Rule println() with Cellular Automaton
in
Programming Questions
•
1 year ago
Hello.
I am trying to work with the cellular automaton rule sets, and I want to be able to find out what rule is being rendered with a println so that I have it for reference with the project I'm working on (screen printing the images.)
Any help would be lovely, I'm still fairly new to the program.
The CA part of the code is, at the moment, the default from here: http://processing.org/learning/topics/wolfram.htmlCA ca;
void setup() {size(500,500);background(255);int[] ruleset = {0,1,0,0,1,0,1,0};loadPixels();pixels[width/2] = color(0);ca = new CA(ruleset);}
void draw() {ca.render();ca.generate();}
void mousePressed() {background(255);ca.randomize();ca.restart();println();//here is where I want to put in a println that will display what rule is being generated}
1