There are no random numbers (unless you randomize!) or complex formulas involved. Just 0, 1, XOR, and the universe size. You could do this in your head. :-)
The XOR operator converts two binary inputs into a single output. The output is 1 if only one of the two inputs is 1, otherwise it is 0. The operation is irreversible because we cannot know which of the two inputs was 1.
If we apply this operator repeatedly in a ring-shaped data structure, we get four different universe patterns for any ring size. Four because we can vary movement direction and comparison direction. Note the symmetries -- any of the four universes can be connected to copies of itself on all sides, ad infinitum.
The seed value of the ring is irrelevant -- it is set to 1 here; if it was set to 0 we would have to use XNOR instead of XOR, but the result would be the same.
We display as many lines as our universe size, then refresh. But at any point in time,
the state of universe 249L1 is really just represented in 249 bits!
You can check its state by looking at the
variable in your developer console.
When you randomize, each of the universe arrays gets assigned a sequence of random 0s and 1s. In some universes, this will put you in a state that's otherwise unreachable -- in others it is just part of their natural cycle. You may notice that large-scale patterns tend to disappear while small-scale behavioral differences remain.
All universes repeat not just in space but also in time. When they start repeating varies. The contents of the ring appear to repeat at minimum at universe size2 (for any universe with a size that is a power of 2), and at maximum at 2universe size.
You can compare the results with an elementary cellular automaton of the same size by
?ECA=<number between 0 and 255> to the URL, e.g.
rule 60. Rule 60 is the closest to the type 2
universes shown here, but has a typically much shorter cycle length.