- Author:
- Aaron Marasco
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- github.com/aaronm67
- Compo:
- classic
- Demo link:
- https://js1k.com/2012-love/demo/1120
- Shortlink:
- https://js1k.com/1120
- Blog post:
- please update here!
- Bytes:
- 1023
- Chars:
- 1023
- Submission
_="_=Functi`;IPM=docum@.createEzm@(Hb.insertBee(M,cqi=[];(h=j;h--;)i[h]=[]rk;e--;)Styz=A'red':'#ddd',Rect(e*f+1,H*f+1,f-1,f-1Fq 0;e<k;e&){n=A-1:0;(hh;h&)(oo;o&)g[(j+H+h)%j][(k+e+o)%-k]n&;A1<n4>U):3==U)}g=i;S'Gen'+t&;r(GczaruLu=setF,O),JZV(E=tq F(g=iO=99;N~up\"Kwidth=lWidth-OKheight=dHeight-200;f d/30k lj dD=u=J;Q~textC`t@\"\"pS=MW~butt`V=M;VE=!E;VE?L'End':G'Go'I(WM\"Czar\";M=Z\"aM\"Speed\"\"inputM~range\";M.max=O*5;=O;M.`changeO=;E(GL()c.downG(DZ H=j>>1-j;h=k>>1;g[313142424h5353626271718h]Kmove=cPhYTop)eXLeft)/v/.test(H)?D?(p,D=0):1==p():(p||(=!),D=J,EL()r r ";for(Z in $="~=\"zle`on.typeUn(iPH\",\"K;c.Jp=0Ag?@ent&++ (=inner=-1;2>a.fillM.valueg[h()||;I(/f[N]for=1&&) (H.page-c.offsetInterval(+hh-[H[Q]=onmouse =~~(\"for(H=0;H<j;H++)for(e=][e]);]=g[=_(\"+H][".split(""))_=_.replace(RegExp($[Z][0],"g"),$[Z].slice(1));eval(_)
- Description
- http://en.wikipedia.org/wiki/Conway's_Game_of_Life
Click or Click/Drag to make shapes, then click "Go" to start the simulation.
- Base64 encoded
Xz0iXz1GdW5jdGlgO0lQTT1kb2N1bUAuY3JlYXRlRXptQChIBWIuaW5zZXJ0QmUXZShNLGMUcQNpPVtdOxcoaD1qO2gtLTspaVtoXT1bXQhyAwdrO2UtLTspH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VzZQEJPX5+KAEIXCIFAQdmb3IoSD0wO0g8ajtIKyspZm9yKGU9AQZdW2VdAQUpOwEEXT1nWwEDPV8oXCIBAitIXVsiLnNwbGl0KCIBIikpXz1fLnJlcGxhY2UoUmVnRXhwKCRbWl1bMF0sImciKSwkW1pdLnNsaWNlKDEpKTtldmFsKF8p
- Original source
_ = Function;
I = _("H", "M=document.createElement(H);b.insertBefore(M,c)");
q = _("i=[];for(h=j;h--;)i[h]=[]");
r = _("for(H=0;H<j;H++)for(e=k;e--;)a.fillStyle=g[H][e]?'red':'#ddd',a.fillRect(e*f+1,H*f+1,f-1,f-1)");
F = _("q();for(H=0;H<j;H++)for(e=0;e<k;e++){n=g[H][e]?-1:0;for(h=-1;2>h;h++)for(o=-1;2>o;o++)g[(j+H+h)%j][(k+e+o)%-k]&&n++;g[H][e]?1<n&&4>n&&(i[H][e]=1):3==n&&(i[H][e]=1)}g=i;S[Q]='Gen'+t++;r()");
G = _("clearInterval(u)");
L = _("u=setInterval(F,O),p=0");
Z = _("V[N](E=t=1);q();F(g=i)");
O = 99;
N = "onmouseup";
c.width = l = innerWidth - O;
c.height = d = innerHeight - 200;
f = ~~(d / 30);
k = ~~(l / f);
j = ~~(d / f);
D = u = p = 0;
Q = "textContent";
I("p");
S = M;
I(W = "button");
V=M;
V[N]= _("E=!E;V[Q]=E?L()||'End':G()||'Go'");
I(W);
M[Q] = "Clear";
M[N] = Z;
I("a");
M[Q] = "Speed";
I("input");
M.type = "range";
M.max = O*5;
M.value = O;
M.onchange = _("O=M.value;E&&(G()||L())");
c.onmousedown = _("G(D=1)");
Z();
H = j>>1-j;
h = k>>1;
g[3+H][h-1]=g[3+H][1+h]=g[4+H][h-2]=g[4+H][2+h]=g[4+H][h]=g[5+H][h-3]=g[5+H][3+h]=g[6+H][h-2]=g[6+H][2+h]=g[7+H][h-1]=g[7+H][1+h]=g[8+H][h]=1;
c.onmousemove = c[N] = _("H", "h=~~((H.pageY-c.offsetTop)/f);e=~~((H.pageX-c.offsetLeft)/f);/v/.test(H.type)?D?(p=1,D=0):1==p&&(g[h][e]=1):(p||(g[h][e]=!g[h][e]),D=p=0,E&&L());r()");
r();