Postreal Media
OneDCA
OneDCA.pm is a perl module which acts as a one-dimensional cellular automaton using any of 256 possible rules. It was initially coded in the summer of 2003, and then forgotten about for newer and shinier toys, and never released. Besides that, another module that does roughly the same thing has been on CPAN since November of 2002.
In any case, it belongs here for completeness, even in it's current, undocumented (Use The Source, Luke) state. The design principles behind it weren't the best anyway, and I am currently working on a module with better ones -- i.e. one which will encapsulate an automaton of arbitrary dimension made up of cells containing arbitrary objects.
Download the module here.
(part below pulled from this module's original site)
As with any cellular automaton, the one-dimensional variation is composed of a "universe" which contains the current information at any time t and the rules which specify how that information will be transformed at t + 1. Von Neumann and Conway both studied two-dimensional cellular automata, which have a universe composed of a two-dimensional field of bits (or integers, etc.). These are remarkable for the patterns they may generate in each frame, easily viewable as separate entities. Viewing the evolution of one over its entire history is problematic, however, as you can only look at the frames one or two at a time. One-dimensional cellular automata do not have this problem because their universe is a line of values, called sites. Hence, to display the evolution of this kind of automaton, you need only to look at a stack of these lines over time, such as those generated by this script.
Rules may be examined in terms of k and r, where k is the number of possible states a site may take, and r is the distance in sites that are taken into consideration. Thus, a binary automaton that looks at itself and its two neighbors to decide its next state has k = 2 and r = 1.
The number of possible rules to use for computation with a given k and r are kk2r+1, a number that becomes huge for even small values of either. For the elementary k = 2 and r = 1 automatons, there are 256 possible rules by which the automaton can evolve. For example, one rule might be to take the XOR of the surrounding two values at t to decide a site's value at t + 1. This rule, viewed as a table, would look like:
Values at t: 111 110 101 100 011 010 001 000
--- --- --- --- --- --- --- ---
Value at t + 1: 0 1 0 1 1 0 1 0
This is, as you may be able to tell by the binary string, rule #90. When run, it produces a pattern that looks much like the Sierpinski gasket familliar to anybody who has studied fractals. The script is set up to run with rule #30, which is another interesting variation. When run, rule 30 produces chaotic (i.e. linearly indeterminate) output, even with something as simple as a single on bit as input. Take a look to see what I mean.
