View demo hosted on Dropbox (Firefox only)
For these parameters, the simulation starts out with noise. Radiating waves slowly form. Eventually the solution converges to spiral waves.
In addition to refactoring expressions to reduce size and using invalid HTML, the code also takes advantage of the facts that
- indecies into a 256 x 256 array can be wrapped horizontally and veritcally by masking with 0xffff, yielding periodic boundary conditions for free
- a succinct way to get a grayscale canvas on a white page is to just write to the alpha bytes of the canva's image data
- "for(i=N;i--)" iterates over 0 to N-1 in reverse order, and is shorter than "for(i=0;i<N;i++)"