R=Math.random;g=[];o=[];m=256;n=16;c.width=c.height=m;c.onclick=function(w){l<3&&(x=w.pageX-8,y=w.pageY-8,x=(x-x%n)/n,y=(y-y%n)/n,a.clearRect(x*n,y*n,n,n),k[0]>x&&(k[0]=x),k[1]>y&&(k[1]=y),k[2]<x&&(k[2]=x),k[3]<y&&(k[3]=y),++k[4])};h=b.appendChild(document.createElement("p"));function I(){a.fillRect(0,0,m,m);l=o.length;h.innerHTML=l<3?(k=o[l]=[m,m,0,0,0],"Draw a"+[" plant","n animal"," 2nd animal"][l]+"<button onclick='k[5]=c.toDataURL();I()'>done</button>"):(setInterval(function(){a.fillRect(0,0,m,m);t=g.slice();for(i=0;i<m;i++){r=R()*50;t[i]+1||(t[i]=g[i]=r-r%1);x=i%n;y=(i-x)/n;v=o[t[i]];if(t[i]<3){p=new Image;p.src=v[5];a.clearRect(x*n,y*n,n,n);a.drawImage(p,x*n,y*n,n,n);f=v[2]-v[0];q=v[3]-v[1];s=f*q;e=v[4]/s;u=f+q;for(j=0;j<4;j++){d=i+[-1,1,-n,n][j];[x>0,x<15,y>0,y<15][j]&&R()<(t[i]?(j<2?f/u:q/u)*3/s:1/s*0.1)&&(g[d]>3&&(g[d]=g[i],g[d]&&(g[i]=j=4)),t[d]||(t[i]&&e>0.7&&(g[d]=j=4)),t[d]&&t[d]<3&&(t[i]&&e<0.7&&(g[d]=j=4)),t[d]==t[i]&&(t[i+1]>3&&R()<e&&(t[i+1]=g[i+1]=g[i],j=4)))}}}},250),"")}I();
Uj1NYXRoLnJhbmRvbTtnPVtdO289W107bT0yNTY7bj0xNjtjLndpZHRoPWMuaGVpZ2h0PW07Yy5vbmNsaWNrPWZ1bmN0aW9uKHcpe2w8MyYmKHg9dy5wYWdlWC04LHk9dy5wYWdlWS04LHg9KHgteCVuKS9uLHk9KHkteSVuKS9uLGEuY2xlYXJSZWN0KHgqbix5Km4sbixuKSxrWzBdPngmJihrWzBdPXgpLGtbMV0+eSYmKGtbMV09eSksa1syXTx4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