Simulates 128 males and 128 females randomly bouncing around, and becoming paired when opposite genders meet. Relationships end after a while (and are followed by a short no-relationship period). The…
f=480;m=0;n=[];i=5;h=Math;l=h.PI*2;j=0.5;function d(){u=[0,0];o=m;a.fillStyle="#FFF";a.fillRect(0,0,f,f);while(--o>=0){g=n[o];with(a){beginPath();strokeStyle=g.c>0?"#000":g.g?"#00D":"#C0C";arc(g.a,g.b,i,0,l);stroke();beginPath();arc(g.a,g.b,i-2,0,l*g.c/g.f);stroke()}if(g.c>0){if(--g.c==0){g.c=g.f=-40}}else{++u[g.g];if(g.c<0){++g.c}e("a","d");e("b","e")}p=-1;while(++p<o){q=n[p];s=q.a-g.a;t=q.b-g.b;r=s*s+t*t;if(r<i*i*4){r=1/h.sqrt(r);s=s*r;t=t*r;if(q.c<=0){q.d=s;q.e=t}if(g.c<=0){g.d=-s;g.e=-t}if(g.c==0&&q.c==0&&q.g!=g.g){q.c=g.c=q.f=g.f=250+1000*h.floor(h.random())}}}}k(0,u[0],"#C8C");k(u[0],u[0]+u[1],"#88D");k(u[0]+u[1],m,"#333");setTimeout(d,1)}function e(w,x){v=h.abs(g[x]);if(g[w]<i){g[x]=v}if(g[w]>f-i){g[x]=-v}g[w]+=g[x]*j}function k(x,y,w){v=l/m;with(a){beginPath();fillStyle=w;arc(19,19,14,x*v,y*v);lineTo(19,19);fill();beginPath();strokeStyle=w;arc(19,19,16,x*v,y*v);stroke()}}c.width=c.height=f;while(m<256){n.push({a:(1+m%16)*f/17,b:(1+m/16)*f/17,d:h.cos(m*607),e:h.sin(m*607),c:-50,f:-50,g:m%2});m++}d()
Zj00ODA7bT0wO249W107aT01O2g9TWF0aDtsPWguUEkqMjtqPTAuNTtmdW5jdGlvbiBkKCl7dT1bMCwwXTtvPW07YS5maWxsU3R5bGU9IiNGRkYiO2EuZmlsbFJlY3QoMCwwLGYsZik7d2hpbGUoLS1vPj0wKXtnPW5bb107d2l0aChhKXtiZWdpblBhdGgoKTtzdHJva2VTdHlsZT1nLm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