Sunday, September 21, 2014

Pascal's triangles in HTML5

I did this animation in Flash long time ago, but I wanted to see it on my iPhone so I ported it to JavaScript using canvas and web audio.


The animation is a Pascal triangle reflected in the X and Y axis, where the empty cells are the numbers that are divisible by some random number (not prime) selected for every drawing pass, and the cells in colors are randomly colored accordingly to their residue by the same random number. The source code has all the nitty-gritty details.


The standalone version with music can be found here.

No comments:

Post a Comment