Iβm on day two of my attempt to spend an hour every day building something fun with code; Yesterday I looked at 2D cellular automata by building Conwayβs Game of Life, today Iβm going to stick to the theme but drop down a dimension to 1D and look at pattern generation by rendering elementary cellular automaton π using the Wolfram Code Rules π.
βWolfram code is a widely used numbering system for one-dimensional cellular automaton rules, introduced by Stephen Wolfram in a 1983 paper and popularized in his book A New Kind of Science.β (Wikipedia π)
Each row on the horizontal axis is a generation of cells and the vertical axis shows each successive generation based on the rules.
There are 256 possible rules based on the fact there are 8 possible states that a cell and itβs neighbours could be in, and two possible results for each of those states (on or off). Not all of the rules give interesting results and some are inversions or reflections of other rules, but the variation is captivating, as is how patterns from nature jump out in some of them. Most the patterns do not actually repeat but they seem to make some intuitive sense to our brains. Iβd love to see some of these woven or printed on fabric as giant non-repeating patterns.
The examples below are all generated live and if you reload the page you will get new patterns following the same rules.