A simple three-colored game of Life. Three differently-shaded lifeforms strive to survive on looped field. Click to restart. Right click to switch to RGB color scheme and back.
/* Dandelion <3 */
(S=String.prototype).r=S.replace;eval('c.width=(c.height=S=5*(m=100))+50;e=[[p=-1,pW0,pW1,pW1,0W1,1W0,1Wp,1Wp,0Wp,p]];f=(Y=["blue","redX,Z=["lime","#002f00X);Fj(a,b){Hz=m;z--;)Ha[z]=[],y=m;y--;)a[z][y]=b?[0,0,0,0,0]:0}Fl(m){GMath.floor(Math.random()*m)}Fh(a){Ga-m?a+1?a:m-1:0}Fk(v){Hz=r=5;--z;)if(r=v[z]?r:z,v[z]>1)Gz;Gr}Fg(){j(i=[],1);EHw=8;w--;)if(v=d[h(x+e[w][0])][h(y+e[w][1])])iQ[0]++,iQ[v]++;s=[0,0,0,0,0];Ev=iQ,s[dQ=v[0]<2?0:v[0]>3?0:((r=dQ)||v[0]-3)?r:k(v)]++;IRect(S,0,50,S);IStyle="rgba(200,255,200,0.3)";IRect(0,0,S,S);Hz=0;z<4;){IStyle=f[z++];IText(s[z],S+15,z*20);Eif(dQ==z)IRect(5*x,5*y,5,5)}setTimeout("g()",1)}Fn(){j(d=[]);Hv=4;--v;){t=l(m);u=l(m);q=[1,3,5,7];q[l(4)]+=l(2)?p:1;Hw=4;w--;)B=e[q[w]],d[h(t+B[0])][h(u+B[1])]=d[t][u]=v}}b.onclick=F(){n()};g(n(b.oncontextmenu=F(e){f=f==Y?Z:Y;e.preventDefault()}))'.r(/F/g,"function ").r(/G/g,"return ").r(/E/g,"Hx=0;x<m;x++)Hy=m;y--;)").r(/Q/g,"[x][y]").r(/H/g,"for(").r(/I/g,"a.fill").r(/X/g,'","green","white"]').r(/W/g,"],["))
LyogRGFuZGVsaW9uIDwzICovDQooUz1TdHJpbmcucHJvdG90eXBlKS5yPVMucmVwbGFjZTtldmFsKCdjLndpZHRoPShjLmhlaWdodD1TPTUqKG09MTAwKSkrNTA7ZT1bW3A9LTEscFcwLHBXMSxwVzEsMFcxLD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