CA2D 4 Mac: A Snazzy way to Investigate the Diverse CA Field
Chris King


Download the CA2D Mac application with XCode source files, documentation and examples.

CA2D is designed as a Mac application to provide a research tool to explore as wide a variety of 1D and 2D cellular automata as possible, while at the same time providing a fast high-resolution artistically appealing easy to use interface, which is ideal for exploring the surprising graphical features of these processes. It comes with source code, so you can reprogram it easily using XCode for new ideas, but also has input rules for a vast array of interesting known CAs spanning most key types.

If you are more interested in technical representation of CA rule schemes and constructing self-replicating CAs with complex computational instruction sets, try the cross-platform open-source application Golly, which runs on Windows, Linus and Mac OS. If you are using Windows Mirek's Cellebration also has a large library of CAs. The Rule Table Repository is a valuable place to investigate the diversity of CAs and find new rule tables. Cellular Automata also has a large list of Java examples.

This page provides some quite stunning examples of the CAs invoked in CA2D and how the controls work. The application is designed as an open source research tool to investigate 2D cellular automata, given the high performance of current intel macs.

It begins with the Moore neighborhood Infect CA on 10000 iterations at a moderate speed.


Infect starts out random but goes through globular waves then looser and finally tight spials taking over the region.

Some of the CAs use a Von Neumann neighbourhood consisting of center C and four neighbours N, S, E and W. Others such as the game of life use the Moore neighbourhood with NE, SE, NW and SW as well.

CA Types

  1. Life-generations begins with the game of life but can be used to run any life-like or generations type CA using the input rules capability.
  2. Neumann allows for defining any von Neumann four neighbour neighbourhood CNSEW rule.
  3. 1D Rule does the same for 1D automata of neighbourhood up to 7.
  4. 1D Life/Gen does the same as life-generations in 1 dimension.
  5. Infect models the spiral waves developing in chemical waves and disease models, starting from a random state and has 30 states of infection. The parameters can be varied as input rules.
  6. Demons cyclic CA illustrates a classic cyclic CA proceeding from a random to a spiral dynamic. Further cyclic CAs can be input as rules.
  7. Quantum wave simulates quantum wave functions in the classically chaotic stadium and other potential wells. At the end of around 2000 iterations, it produces an image of the scar.
  8. Dilemma runs a model of the classic prisoners' dilemma evolutionary strategy game, in which you can adjust the payoffs and mutation rates via input rules.
  9. Diffuse Aggregate provides an example of a gas model coalescing to form fractal dendrites.
  10. Byl Loops illustrate a simple self-replicating CA and Sexy Loops elaborate this process into a genetic process which can confer sexual transfer, as well as illustrating mutational evolution and natural selection.
  11. Maze Solver is a CA which solves standard mazes including local solutions of CA derived pseudo-mazes.
  12. Time tunnel is a 4-state CA which develops slowly from its initial condition, but after 5000 or so iterations begins to take on a wild chaotic leopard skin dynamic.
  13. There are a variety of other CAs with fractal and dynamic properties, including BBC2, Brain, Fires, Diffusion, Persian, Hour-glass, Shrike, Sand Pile.

The codes defining a sample of the resident CAs are listed here so you can see how each of them work. The rest can be accessed in the updated source code. The first eight or so options also enable the input of a wide variety of rule defined CAs. Finally it is easy and completely general to be able to program the CAs with no restrictions, using the source code, so entirely new types of CAs can be constructed.


The demons CA also proceeds from randomness to structure.

Color Modes

There are several colour schemes which are useful for specific CAs. Bit Color 8 gives integer RGB values of 0 or 1 for each channel, giving colors mod 8. KRGB gives a four colour mode which extends to more states by graduation. RYGCBM gives a rainbow sequence. KRYGCBMW (the default) runs from black through the rainbow to white graduated to the number of states. AbsSinRGB runs sinusoidally as does ShiftedSin. These are slower to compute than the default. Finally LoopCols gives the traditional color coding for Byl and Sexy Loops.


BBC2, Persian and Space Fractal illustrate fractal CAs.

Controls

  1. If you set the speed slider you can see the CA develop more slowly, or rapidly.
  2. Scale allows a blow up of a smaller window. The window has wrap around so it's toroidal, with left and right margins and top and bottom margins joined.
  3. Steps gives how many steps for the next process. Redraw initializes a new CA.
  4. You can take a step at a time by inputting s into the start arrary at a given point , setting steps to 1 and Redrawing repeatedly.
  5. You can start and stop the process using the start/stop menu or command-S.
  6. To quit use the Quit menu or command-Q.
  7. To initialize a new pattern press Redraw and make sure to start again as well if you have stopped.
  8. You can rezize the window for a smaller or larger view, which will also restart the CA from initial conditions.
  9. You MUST stick to the input rule formats defined below. Delete any existing rules before starting a new type of CA, as this may otherwise cause an interpretation error, if the rule doesn't follow the format of the new CA, as only minor error protection is invoked for the input rules.


Time tunnel has a long evolution from diamonds to patchworks with the invasion of singular cells
ultimately resulting in a wild leopard-skin dynamic. Click on image to enlarge.

Starting the process and switching CAs

You can type or paste in a start matrix of numbers 0-9 (or higher values using ASCII single character bytes) as a text string in Start Matrix to override the options provided e.g. 010011111 will start the life CA with a 3x3 matrix corresponding to a glider formation. Try 2112144114412112 with Infect for a wild visual! Try shrike with 242121242 for an interlocked trellis. Max size is 166x166. This provides ample opportunity to input complex stating states. You can easily paste up a large array of numbers using text edit. The start array processor in CA2D ignores line feeds and carriage returns, so you can copy and paste in a square array of numbers up to 300x330.

Inserting r will provide a random screen-filling array in the number of cell states used by the rule. Inserting s retains the existing screen and proceeds to a new CA on Redraw. This provides a great opportuity to explore the different CAs using previous states as startin conditions. Try alternating between demons or Persian and hour glass, or for an interesting cascade. If you need a finite random array use can use the random growth CA followed by s.

Life and life/generation CAs begin by default with the R-pentomino for classic Life, which takes 1103 generations to stabilize. If you enter e in the start matrix for Life, you get record methuselah edna taking 31192 generations to stabilize. Or you can paste it as an array.

Try copying and pasting the spacecrazy array directly from text edit and starting Life/Generations for the classic game of life in scale 1-4 and you will get a gosper gun gradually taking out a delicate fleet of caterpillar spaceships traveling at varying speeds! See also the fortress and changing lines.


CA2D running Conway's Game of Life CA with color coded aging. A Gosper gun firing off a collection of spaceships using a pasted array.

Using Input Rules for 2D CAs

All the CAs from Infect up on the CA list can be modified by using input rules. In addition to the rules listed below, there are also several rule lists which expand the number of examples from 10 to way over a googol (or 10^100) to around 110^1000 options.

A: Life-like and Generation rules

You can enter a life rule for life-like CAs under Life/Generations in the form bbb;sss;g where b are the birth numbers of neighbours s are the survival numbers and g is the generations.

Type 1 Life-like Life itself is 3;23 meaning that a cell lives on if 2 or 3 Moore neighbours are alive and is born if 3 are alive. Other good examples are Seeds 2; Life without Death 3;012345678 Day&Night 3678;34678 and Diamoeba 35678;5678 Life-like automatically have 2 generations live and dead, and are coloured by age, however the same rule with ;2 appended, e.g. 3;23;2 for life gives the 2-colour version List of life-like rules

You can also generate a classic example of Day and Night guns and anti-guns shooting it out by pasting gunantigun into the start array and using 3678;34678


Hour Glass has a falling fractal interacting with a stationary one. Brain, a classic generations rule modeling an excitable medium such as brain tissue, here set off by a fractal precursor, has many types of colliding and regenerating structure. Brain is equivalent to the 3-state generations life-like CA 2;;3. A receptive cell (0) becomes excited (2) if two neighbors are active, then undergoing a latency step (1) before again becoming receptive (0). Click on image to enlarge.

Type 2 Generation You can also input any of the "generations" CAs, which have some of the most interesting dynamics properties, like brain, by inputting an extended code into Life. For example brain itself is equivalent to 2;;3 and space wars to 2;345;4. This gives life with aging rather than death colour coded by age. Dead cells come alive and then age steadily until they reach the lowest state where they are again assessed for survival as live. The last number, anything from 2 to 48 or so, gives the number of aging states. List of generation rules.

Mirek's rule 2;345;4 from the list can be used to generate a neat steeplechase of 'worms' if you copy and paste the steeplechase text array. View in scale 4.

BBC2 (default 4) and Random Growth (defalult 8) are useful precursors which will assume the same number of states as the last parameter in a generations type rule preceded by two semi-colons by inputting e.g. ;;6 or 12;345;6 into either BBC2 or Random Growth, which will then have 6 states. This means can switch to generations 12;345;6 with s set for starting array to continue from a radom or fractal island with the correct number of states. For a life-like game you can initally set ;;2 for 2-state random. For a larger number of states, in life-like CAs, random growth acts as a random-edged block which can result in interesting dynamics developing around the edge, where 2 and 3 naighbours prevail.

B General von Neumann Rules

You can also input any CNSEW von Neumann neighborhood rule and select Neumann Rule to portray a variety of well-known von Neumann neighborhood rules of up to 4 states like Fredkin2 201101001100101101001011001101001 The first number gives how many cell states s and the reminder give the value for each of the s^5 neighbours in the bit order CNESW. List of Neumann rules. You can also perform random searches of these states using the formula srtnnn, where s is the number of states, r is for random search, t is the search type and 0.nnn is the probability parameter biasing the search. (See 1D CAs below for details).


Demon 2013 shows two stage engulfing

C Cyclic CA Rules

Demon Cyclic CAs have rules in which a cell is upgraded a unit cyclically if a number of neighbours over a threshold have one greater value. Input a rule of the form sstn where ss = 02 - 99 is the number of states, t = threshold, and n is the neighbourhood type 0 = von Neumann, 1,2 = Moore 3,4 = radius 2 von Neumann. In 2 and 4 the diagonal and radius two quartets count as having value 2 more and 3 more respectively. The default is 0810 but 1610 gives a longer burst into a more prominent demons, and 2012 gives an further cyclic demon phenomenon. Several other configurations e.g. 0431, 0320, 0621, 0823 lead to highly variable stratification or equilibrium states. 2013 and 3614 give interesting examples of demons from larger neighbourhoods

Pattern Breeder is a slightly different type of cyclic CA. The rule is 00snm, where s are the states, n is the neighbourhood type 0=vN 1,2=M or 3,4=r2 as above and m = 0 gives the count of non-zero mod s and m = 1 gives the neighbour sum mod s. The default 002n0 makes a cell alive if an even number of neighbours in any neighbourhood of the three types above are alive. It needs a good starting configuation e.g. running BBC2 to make a small seed fractal and then running it using start array opion s, where it appears to replicate seed patterns in miniature.


Infect 36;06;2.0;3.0 shows 4 generations of growing complexity islands, with one spawning spirals.

Infect Cyclic CAs modelling spread of infectious diseases and autocatalytic chemical waves such as the Belousov-Zhabotinski reaction, have more complex cyclic rules involving three additional parameters. A rule is input in the form ss;gg;pp,qq, where ss is the number of states 00 - 99, and gg, pp, and qq determine how the infection proceeds. An infected cell is modified by s/A+gg, the sum of the infected neighbour states s over the number of infected cells A plus gg. A non-infected cell is infected at a level equalling A/pp + B/qq the number of infected neighbours A over pp + number reaching max level B over qq. The default is 29;07;2.0;3.0.

Try 36;06;2.0;3.0 for a fascinatng evolution. It generates islands which grow to engulf the region, growing more complex as they grow, forming several geneations. Ultimately one of these islands spawns a spiral which engufs it while it is at the same time engulfing the entire region. 99;04;3.0;3.5 is even more dynamic!


Above a wave function for a wave generating the bow tie scarring (below) Click on image to enlarge.

Quantum Chaos and Wave Function CAs

A unique CA, based on a chequerboard-iterating neighbourhood in two stages, is the CA developed by the author to study quantum chaos and quantum wave functions in the stadium and other potential well chambers. The rules are very simple. Each iteration occurs on an alternate chequerboard of either the black or white squares. We take (-2C+N+S+E+W)/2 for each cell on say the black squares and apply a reflecting condition at any boundary point as well e.g. if E is outside the boundary we take (-2C+N+S+2W)/2. The curved region is actually a series of staggered right angles reflecting e.g. both N and E, replicating the atomic condition of a small quantum wave chamber reasonably acurately. Finally we copy the states found back to the original array so the second half-stage updating the white squares uses the updated values.

This differs from the Margolus neighbourhood, which likewise iterates in two stages, but instead works as a block CA, with each cellular calculation confined within with four cells per square. In this case, the 2-stage proess uses alternate tilings of the plane, with block squares partially overlapping, so that the two stage process enables dynamic motion across the entire plane.

The quantum CA defaults to a bow-tie wave function in the stadium, as illustrated above. This is desigened to run in the default screen size, or the max or min screen sizes, so that the stadium length is twice the width, but will produce rescaled wave functions at any size. You can also run it in a variety of configurations by inputting a code of the form m;nn;pp;q.qqq , where m is the region type ( 0=stadium, 1=rectangle, 2 double slit, and 3= losenge), and nn=00-12 is the wave type. ( 01=radial, 02=horizontal, 03=bow tie, 04= twin diamonds, 05=twin pegs, 06=twin V, 07=rectangular orbit, 08=period 6. 09=cosx*cosy 10=cosx+cosy 11= double slit wave and 12=vertical). 01-08, 12 have wavelengths designed for the stadium in default size. 09, 10 for the rectangular box and 01, 12 for the losenge. pp allows you to determine how far the wave function will go before beginning to calculate a scar in units of 100 steps (Default=01 which is 100 steps). q.qqq allows for scaling the wavelength of the generating wave by an additional factor. This is useful for looking for resonances, particularly in the generic waveforms 01, 02, 09, 10 and 12).

The process completes when the defined numbet of steps are completed, when the display gives an absolute average of wave phase-stepped states, forming a scar. A good number of iterations is 2000.


(Left) Diffusion-limited aggregation into fractal dendritic growth structures with reflectionally and rotationally symmetric flakes
(centre) generated by random gases with the corresponding symmetry. (Right). A fractal gas giving rise to a symmetrical crystal.

Diffusion-Limited Aggregation

Diffuse Aggregate is one of a variety of CA models simulating the effects of gases or solutions. This one is also modelig DLA or diffusion-limited aggregation resulting in fractal dendritic growth, as witnessed in snowflakes, chemical gardens, dendritic formations on electrodes and a variety of other physical systems. A simulation, is included of a von Neumann neighbourhood gas causing fractal growth on a single seed. The rule table includes instructions for bouncing off boundaries, for free passage of the particles through one another except for two hrozontal or vertical particles colliding, when horizontal and vertical switch, and for aggregation events onto the crystal when a particle touches a dendrite tip or side. There are vastly more elaborate lattice gas CAs, but this example give a good generic idea of the process.

If the rule input has an r inserted a small number of particles are allowed to randomly leak into the vacuum to make up for the loss of particles to the crystal. You can also add a 34 into the start array as an R, along with an input array of gas molecules 1>W, 2>N, 4>E, or 8>S in a space of 0's. Larger numbers are superpositions of these and 16 indicating a stationary reflector. If you input fn, n = 0-4 into the start array, the process will generate a reflectionally (f 0,f 2) or rotationally (f 1,f 3) symmetrical gas and crystals, with reflecting barriers for n = 2,3. f alone will remove the reflecting barriers from the non-symmetrical random default condition. The ACSII for the numbers 0-34 are 0123456789:;<=>?@ABCDEFGHIJKLMNOPQR, enabling any initial state to be specified.

You can also generate a fractal gas by using a fractal CA such as BBC2 set to 5 states using rule ;;5 as a seed, and then switching to Diffuse Aggregate on f 4-7. Other numbers of states are spectrally modularized to 5. This array rule replicates f 0-3 above, but using the values of a five state fractal to define the four velocities and the vacuum. The f rule ensures symmetry by replicating fractal or random information from the lower right sector to the other three, with appropriate symmetries in the velocity transformations. To set up the symmetrical gas states, this CA is set to idle in the first step so to go a single step at a time you need to set s for start array and 2 for steps rather than the usual 1.

This system can have very surprising consequences when initial conditions not anticipated in the model arise, which can destroy the apparent symmetry of the rules. For example concentric rings of NESW particles break symmetry because, as they move in different directions, some parts collide and others don't, destroying the apparent symmetry. Two opposing particles collide only if they arrive on the same square at the same time. If they arrive one square apart they will pass right through in the next step as the difference in their velocities is two steps. Fractal structures involving different reflecting boundary states can end up emitting continuous streams of particles if they include a 33 cell, which acts as a continuous particle source in all four directions. To see these effects, try running BBC2 or random growth on rule ;;35 and then run this CA on start array s.


Byl loops in operation in Bit Color 8

Self-Generating and Evolutionary Structures

There are a number of highly coded von Neumann type CAs (distinct from the widely used von Neumann neighbourhood) available in applications like Golly which carry out coded replication of existing structures and are thus able to duplicate themselves to varying degrees.

To include a rather beautiful generic root example of an elemental self generating structure, we include the Byl loop example, in which a single small looping region is able to generate a grid of duplicates of itself as shown in the above figure. The rule table consists of 61 neighbourhood instructions, each in four orientations, consisting of four inner cells forming a very simple code sequence instructing the formation of further loops. Special colors gives the standard Byl Loop colors 0=black, 1=blue, 2=red, 3=green, 4=yellow, 5=magenta.

This is a generic reduction of the original design of Langton's loops, themselves a modification of Codd's CAs, which, like the game of life and 1-D rule 110 (see below) are capable of universal computation and are in turn a simplification of a type of CA originally developed by John von Neumann with the aim of developing a self-replicating universal constructor. Golly and the rule table repository have a number of examples of this class of CA, which can be ported back to Golly for investigation.


F-sexy loops in evolution in Special colors. Left inset the initial condition

Sexy Loops A second more challenging example, derived from Langton and evolutionary Evo loops are F-sexy Loops, which have a similar root form to Langton's and Codd's original structures, but allow for transmission of genetic information between loops using a cell type (9=orange) encoding an elementary sexual gene concept. The loops bounded by red (2), form channels for the movement and transfer of this genetic information and for natural selection of loops with variant genetic information. It further provides an elementary model to test the evolutionary survival of genetic elements providing sexual transfer, such as the F-factor bacterial plasmid.

You can independently utilize a series of alternative initial states such as sl2, which has two loops, the upper left one carrying the sex gene. Other examples check out critical processes discussed in Oros and Nehaniv's research paper to verify the CA, such as introducing the sex gene with and without error correction. The rule table contains two rotationally invariant schemes, one covering all states apart from 8 and a second to model the dissolver cell 8. Color Special gives the original 12-color coding for F-Sexy Loops: 0=black, 1=blue, 2=red, 3=magenta, 4=green, 5=cyan, 6=yellow, 7=white, 8=gray (dissolver), 9=orange (sex gene), 10=pink (signal blocker), 11=dark gray (error correction).


The author's image chris.txt cloned by a simple summative CA in Special colors.

Winograd Replicator One of the simplest systems of all developed by Terry Winograd is counter-intuitively capable of generating replicates of any image. Generalizing the Friedkin replicative life game 1357;1357, we have the rule, which says for any prime number p of states, C(out) = sum(NSEW) mod p. The included rule Default sum is set to replicate a simple 9x9 heart pattern in 3 colors at steps 9, 18 etc. For a more interesting effect the 121x121 template chris.txt is included which can be pasted into the start array with the rule set to 11 for 11 states using Special color, resulting in the above cloned image set, at the 121st and 242nd steps.


Left: Maze Solver solving a simple maze, showing the arrow directions in different colors (greens flood fill, magentas back path). Live ends of the flood are the single cells in white. Start and finish are the single red and yellow cells. Right: Maze Solver solving a more complicated maze generated by using the life-like 'maze' CA 3;12345;2 starting from the life-CA default R-pentamino with start and finish points (194,299) and (627,500). The flood fill is in magenta and the return path in yellow. Most, but not all of the toroidal universe is accessable from the starting point showing the maze is connected and non-trivial but contains a large number of disconnected islands.

Maze Solver An intriguing CA developed by Adam Goucher performs a flood fill of a maze. The rule table keeps hidden track of the directions used in the fill, enabling a reverse path to be traversed via the reversed arrows from finish to start. The default is the start array maze.txt. Special color shows the flood fill and return path but the default KRYGCBMW shades so the arrow directions can be distinguished, so you can see how the CA works, as illustrated above. There are a set of larger more complex computer-generated mazes in the mazes folder which can be pasted into the start array. You can generate more here. Note that the flood fill is quite happy with mazes with irregular shapes, as long as there is a vertical or horizontal connection between adjacent cells.

Maze solver can also solve pseudo-mazes generated by another life-like CA. Run the Life/Generations 'maze' CA 3;12345;2 from a seed and then set start array to sxxxyyyXXXYYY where xxx and yyy specify the x and y coordinates of the start point and XXX, YYY those of the finish point. Then Redraw with Maze Solver to see a CA solving a CA-generated maze. The above image was generated using the default R-pentamino (start array 011110010 has the same effect) with Life/Generation CA 3;12345;2 and then solving using s194299627300. You MUST use three digits for each coordinate e.g. 020 for 20! The same coordinaties will also give a successful solution for the maze with seed 1010111011011101.You can also try 'mazectric' 3;1234;2, bu this is not as capable of generating a global maze. Starting array 0101010101110111010101010 lads to a fractal pseudo-maze with fourfold symmetry, but this has fragmented into a number of larger and smaller open islands islands in a closed ocean, forming a phase transition from the condition of the maze CA shown above, which admits percolation through the toroidal space within the global network and has closed islands in an open ocean.

If you don't include the coordinates and just insert s, or just snn, Maze Solver will use a random set of start and finish points and attempt a series of local solutions. The default nn is 06 i.e. one random start point and 5 finish points for every 6000 points. Any start point will locate paths to many finish points, but the flood fills from individual start points will exclude one another, even if the mazes do connect. Generally random start arrays produce poorer pseudo-mazes than those proceeding from a small seed like the R-pentamino. Using s with Maze Solver inverts live and dead cells of the life CA before proceeding, so that the corridors are marked zero, so if you want to restart this CA from a previous state, you need first to do a dummy restart with 0 steps to give an extra flip, or you will be using the inverse of the previous state.

Sand Pile gives a vertical view of a Per Bak sand pile CA which exemplifies self-organized criticality to the critical angle due to fractal avalanches. The CA values represent local slopes rather than the height of the pile, so all tend to the critical value. Whenever a slope exceeds a critical value, an amount is subtracted from the cell and a quater of the amount added to each of the the neighboring NSEW cells.


A series of prisoners dilemma games show varying success of the strategies on differing payoffs.
(1-3) evolution under the default 3051;50;10;05. Defect black, tit-for-tat yellow, simpleton red, random cooperate green, and cooperate blue.
(4-5) 2050;25;10;05 results in hard defection followed by domination by tit-for-tat. (6) 4050;25;10;05 now has a mix of cooperate and simpleton
but if random is made more cooperative, it then becomes most populous.

Prisoners' Dilemma

The prisoners' dilemma is a famous game of evolutionary strategy in which two co-defendents are tempted to accuse one another in the hopes of getting off, but both betray one another and receive a long punishment rather, than the lighter sentence if they had stuck to a common plea of innocence, because the temptation to defect leads to double jeopardy of mutual defection, in which both lose out. It has been applied to nuclear mutually assured destruction, as well as sexual relationships.and the Red Queen evolutionary race between parasites and hosts. This is an intrinsically more complicated cellular interaction because it requires playing several rounds against all Moore neighbours for each cell and after a series of say five rounds, giving the cell to the winning strategy in the neighbourhood.

The simulation, ported from Gary Flake's open souce program, has five resident strategies: always cooperate (red), always defect (black), tit-for-tat (doing what your opponent did last time), Pavlov or simpleton (win-stay lose-shift, i.e. chenge what you did if you got punished last time) and a strategy randomly switching, in our case, between tit-for-tat and cooperate, with a probability rcp determined by the input rule. In Bit Color 8 the colors are: defect=black, tit-for-tat=yellow, simpleton-=red, random/cooperate=green, and cooperate=blue.New strategies can easily be tested by amending the source code.

The CA can be modified by inputting the four payoffs CC (both cooperate),CD (sucker's penalty),DC (aced the opponent), DD (double jeopardy) as well as rcp, noise, and mutation in the form of the following rule: pppp;rr;nn;mm, where p = 0 - 9, and rr, nn, mm give probabilites 0.xx. Noise causes random changes in a single round, mutation causes a random shift to a new strategy. The default is 3051;50;10;05.


Rule 110 has universal computation, it is unknown if the stalactite right starting with 11 ever finishes.
The 23 state shown takes around 1000 iterations to die out. Right 1D cyclic CA 3871.

1D Automata

Although CA2D focuses on 2D automata, 1D automata provide a very good space-time view of how CAs work. Moreover some of te simplest, like rule 110, possess universal computing capacity like the game of life.

You can enter codes for a 1D CA using CA type 1D Rule in the form tscnnnnnn where t is the rule type, s is the number of states and c is the number of cells used (3 or 5) followed by the array of numbers 0 ... s-1 defining the rule. You can use a start array as previously, either an r for a random start row or enter a 1D array. The display will fill the first screen and then continue to scroll slowly a line at a time if you have steps set above 0. If you set s for the start array after the process has begun, pressing Redraw will instantly produce successive screens of the CA.

Type 1 t =1 lists the full code for a CA. c = 7 s <= 3, c = 5 s <= 5, c = 3, s <= 9. For example the famous rule 110, which like Conway's life is capable of universal computation, so can model any process a Turing machine can and a life board has even been designed to mimic a Turing machine. It lists as 12301101110 where 01101110 is binary for decimal code 110 with each of the 8 binarys determining one of the 3-neighbour 2-states since 2^3=8. If there are 3 or 4 states the rule string will have s^c values each up to 2 or 3.

Similarly rule 30 12300011110 is digitally chaotic. It displays sensitive dependence on initial conditions (two initial configurations that differ only in a small number of cells rapidly diverge), its periodic configurations are dense in the Cantor space of all configurations (there is a periodic configuration with any finite pattern of cells), and it is mixing (for any two finite patterns of cells, there is a configuration containing one pattern that eventually leads to a configuration containing the other pattern) and there is a dense orbit (an initial configuration that eventually displays any finite pattern of cells). It also displays patterns similar to some mollusc shells.

Rule 90 12301011010 also has root significance. In each time step all values are simultaneously replaced by the exclusive or of the two neighboring values.

Type 2 t = 2 is a type of totalistic rule, summing the 3 to 7 neighbours above and providing an entry for each possible sum. For example the famous stalactite has code 2433311100320 with starting matrix 23. Other interesting codes are 2430002213310 1, 2430003211310 r, 2430000131210 r, 2530000004200410 r or 1.

Type 3 t = 3 is a cyclic rule to illustrate time evolution of cyclic CAs. The rule has the form tscn where n is the threshold (see 2D cyclic). For example 3871 leads about half the time to cyclic dominance, while 3471 leads to stratification. 3971 is on the borderline with most random states stratifying, but a few becoming cyclic dominated.

Random searching. You can also input a random rule for types 1 and 2 in the form tscrunnn (n=000-999) e.g. 143r1500. The first number u gives two random search statistics. The last number nnn chooses a three decimal place number 0<p=0.nnn<1

Statistic A u = 1,2 is a biased exponential distribution based on r.ek(r-1) k=2n/3 which gives more low numbers and zeros when p>0. This gives a wide distribution of individual codes somewhat biased logarithmically towards smaller values.

Statistic B u = 3,4 is based on the idea of Chris Langton's edge of chaos lambda, suggesting a proportion of dead states around 0.331 is at the edge of chaos, so it sets a random sequence of non-zero numbers 1 - s -1 and then randomly masks a proportion p of these to 0. You can see a similar approach in David Eck's edge of chaos Java jar applet.

u = 2, 4 pick only isotropic, type 1 rules, which play out palindromically as they have the same value e.g. for 110 and 011. They thus give rise exclusively to symmetric rules. They are of no advantage with type 2 which are already isotropic and limit the search here.

These biased searches help to search for complex systems at the edges of chaos. When steps are set to 0 you can then click Redraw to journey through a random series of CAs to explore their properties. If you input s in the rule the random rule will be preserved so you can explore it using Redraw. The rule generated by a random choice appears in the Rule out field so you can copy it for later exploration.

Mirek and Golly use slightly different rules but many of these examples will also run as rules in this format.

1D Life-like and Generation You can also enter a 1D form of any life-like or generation formula using the following format extending that for the 2D version bbb;sss;g;n where b give the number of cells required for bith, s for survival, g is the number of live generations and n gives the neighbourhood size 3, 5, or 7. The maximum number of live neighbours not counting N which plays the role of C here, are actually 2 for a 3 neighbourhood, 4 for a 5 neighbourhood and 6 for a 7 neighbourhood. e.g. try 12;23;20;7, 123;234;4;7 as well as 2;456;2;7 and the default start up 2;24;2;7.


1D CAs simulating two shells of the author, Christine and Lorien Final.

Shell Pattern CAs By selecting Shell you can also run a variety of 1D CAs modeled to represent the patterns on various mollusc shells. The default is 1;0;12;48;0;011;003;000 Lorien1. Formulae for a series of interesting examples are as follows.

1;2;05;10;0;300;002;000 2;0;06;35;0;050;002;100 KM fig11 3;0;05;12;0;220;004;190 KM fig10
3;8;02;11;0;300;001;000 KM fig9 2;0;10;48;0;000;002;000 KM fig4 4;9;02;18;0;200;002;060 KM fig18iii
4;9;05;38;0;000;002;060 Lorien2 2;4;08;48;0;030;002;055 LorienFin 3;8;02;11;0;300;002;060 Christine

These identify parameters r;R;w1;w2;m0;m1;p;d in the model of:
Kusch I, Markus M 1996 Mollusc Shell Pigmentation: Cellular automation simulations and evidence for undecidability J Theor Biol 178 333-340.

Source Code Programming

Finally you can add new rules freely by including further cases in the source code of sillyballview.m. Default(Sum) is already set up for you to do this simply by opening the source project in XCode resident in every Mac or downloadable from Apple and altering the entry in sillyballview.m wavefn under default. You can add new selections by adding an extra case in the same section and assigning a top size for cell states under the wavefn procedure. You need also to add an extra Cell Rule in the Cell Rule popup button using Interface Builder and add an extra selection entry with the same text name in controller.m.

Mirek's Cellebration gallery has a very complete collection of all these CA types, along with an excellent open source CA simulator for Windows.

See: http://www.dhushara.com/CA/ for full manual, downloads and further research.


Shrike behaves differently depending on the initial conditions. It can end up forming fractals dominated by either a
chequerboard of 1s and 2s or an ocean of 3s or it can develop a complex trellis of interacting and collapsing diamonds.
Click on image to enlarge.


The various CAs can be developed using one another's states as initial conditions.
Here Persian is used followed by Diffuse. Then Fires burns out the interior and grows new dendrites
with its green 'flames' and finally Border attempts to retrace the boundaries. Click on image to enlarge.