Automata1D automata; int rule = 0; void setup() { // The usual environment setup size(300, 300); background(0); // Create a ruleset we want to use int[] rule = {0, 1, 0, 1, 1, 0, 0, 1}; // Create the automata automata = new Automata1D(rule); } void draw() { // run our simulation automata.simulate(); // if the automata is finished, restart it with a random rule if (automata.isDead()) { background(0); automata.randomizeRules(); automata.restart(); } }