A puddle simulator - click anywhere to make it rain. It is a simulation of the 2D wave equation: (http://en.wikipedia.org/wiki/Wave_equation).
c=document.getElementById("c");s=100;window.onload=function(){c.style.width=c.style.height="50%";window.onclick=function(){g[r()][r()]+=4};g=Array(s);p=Array(s);for(i=0;i<s;i++){g[i]=Array(s);p[i]=Array(s)}d(function(m,l){g[m][l]=0;p[m][l]=0},0);x=c.getContext("2d");x.fillStyle="rgb(0,0,190)";setInterval("go()",50)};function r(){return Math.floor((s-2)*Math.random()+1)}function go(){k();f()}
function f(){e=n(g);d(function(m,l){g[m][l]=2*e[m][l]-p[m][l]+0.5*(e[m][l+1]+e[m][l-1]+e[m-1][l]+e[m+1][l]-4*e[m][l]);g[m][l]*=0.98},1);p=e}function n(m){t=Array(s);for(i=0;i<s;i++)t[i]=m[i].slice();return t}function d(m,l){for(i=0+l;i<s-l;i++)for(j=0+l;j<s-l;j++)m(i,j)}function k(){x.clearRect(0,0,300,300);d(function(m,l){c=l*2;b=m*2*0.39;o=10*g[m][l];h=1;a=s-b*0.82-o;if(l==99||m==0)h=10+o;x.fillRect(c+b*0.39,a,1,h)},0)};
Yz1kb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiYyIpO3M9MTAwO3dpbmRvdy5vbmxvYWQ9ZnVuY3Rpb24oKXtjLnN0eWxlLndpZHRoPWMuc3R5bGUuaGVpZ2h0PSI1MCUiO3dpbmRvdy5vbmNsaWNrPWZ1bmN0aW9uKCl7Z1tyKCldW3IoKV0rPTR9O2c9QXJyYXkocyk7cD1BcnJheShzKTtmb3IoaT0wO2k8cztpKyspe2dbaV09QXJyYXkocyk7cFtpXT1BcnJheShzKX1kKGZ1bmN0aW9uKG0sbCl7Z1ttXVtsXT0wO3BbbV1bbF09MH0sMCk7eD1jLmdldENvbnRleHQoIjJkIik7eC5maWxsU3R5bGU9InJnYigwLDAsMTkwKSI7c2V0SW50ZXJ2YWwoImdvKCkiLDUwKX07ZnVuY3Rpb24gcigpe3JldHVybiBNYXRoLmZsb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