First, include the cae.js source in your html:
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:
Depending upon your processor and browser, your outcome will vary greatly.
You can also set the number of pixels per cell:
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: