There are two keys to understanding this code.
1) You need to undertand what the cellular autometa is doing.
2) You need to be famliar with arrays and array syntax. If you're not, go read up about Arrays in processing, and come back when you understand the basics.
3) Okay three keys. You need to understand the basics of Object Oriented programming in Processing or Java.
Also, the second constructor has a bug - it doesn't allocate an empty rule set. You can fix it by inserting the following just before line 12 (before the line that says "randomize();")
Here is some code to exercise this class, in case you don't have it.
CA ca;
void setup()
{
size(500, 400);
ca = new CA();
}
void draw()
{
ca.generate();
ca.render();
}
Perhaps a little easier to see what's going on if you run it. But basically, the two routines you posted are constructors.
The first receives a set of rules, which are an array of 8 numbers (each of which is 1 or 0). You can see the effect of each rule in lines 74-82. Basically for each pattern of 3 bits, it selects one of the rules and uses that to generate the next row. So it scans through the parent cells, and for each group of 3 cells (a,b,c) it generates a new cell z, which is based on the 8 possible combinations of a,b,c.
a b c
z
Oh, and the author is right, that code "could be improved and made more concise". Like it could be reduced to a single line, but it is perhaps easier to understand as is.
The first constructor is passed a set of 8 rules. It initializes a set of cells (one cell for each pixel), and initializes some other variables. The second constructor is essentially the same, but it creates a random set of rules. That's the version I used in my sample code.