The cae.js project is a distillation of the cellular automaton built into the earlier cellular automata explorer project. It is a self-contained javascript class. It can instantiated thusly:

First, include the cae.js source in your html:

<script src="/javascripts/cae.js"></script>

Then create an instance of cae:

my_cae = new cae();
my_cae.init("my_canvas");
my_cae.draw();

And that’s it. Just replace “my_canvas” with the id of the canvas you’d like cae to draw upon, and it will determine the proper width and height. There are a few more moving pieces to fiddle with if you like.

First, frames per second:

my_cae.setFramesPerSecond(60);

Depending upon your processor and browser, your outcome will vary greatly.

You can also set the number of pixels per cell:

my_cae.setPixelsPerCell(5);

The lower limit for pixels per cell is 1, with the upper limit being the min of the width and height of your canvas. Though one cell is going to make for a pretty boring display. Actually, now that I think of it, this would cause the cell to be its own neighbor…

I admit, it’s not very exciting. I think I just invented the zero-dimensional cellular automata.

Now to something much more exciting: