J=15;S=32;o=h=1;W=[];H=Date.now;T=H()+6E4;for(a=0;a<315;)W[a]=(i=a/J|0)*(j=a++%J)&&(j|i)&1&i<20&j+1<J?0:1;f=[new C(16,1),new C(),new C(298,7)];Q=['#888','#632','#1B1','red'];K=setTimeout;m();function D(){for(a in W){v=W[a]?'#000':'#FFF';for(k in f)v=f[k].f[a]>0?Q[k]:v;if(f[2].f[a]==1)v="#AC2";c.fillStyle=v;c.fillRect((a/J|0)*S,(a%J)*S,S,S)}c.fillText((T-H())/1E3|0,36,420)}function m(){if(f[2].l<3)alert('You beat the dragon!!!');do d=Math.random()*4|0;while((d-o&&d+o+1&1)||g(2,d))o=d;D();if(T>H())K(m,400)}function g(i,d){t=f[i];p=t.p+(d>2?1:d>1?J:d?-1:-J);if(!i|W[p])for(k in f)if(f[k].f[p]>0|W[p])return 1;t.p=p;for(R in W)t.f[R]--;t.f[p]=t.l;for(k=0;k<i;k++)if(f[k].f[p]==1){k||h--;for(P in W)f[k].f[p]-=1;f[k].l--}}function C(p,l){t=this;t.f=[];t.f[t.p=p]=t.l=l}function E(p){f[3]=new C(p+1,9);g(3,1);for(q in Q)for(f[3].p=p,z=0;z++<2;)g(3,+q)}b.onkeydown=function(e){d=e.keyCode;36<d&d<41&&g(0,d-37);X=f[0].p;if(T>H()){if(h*d==32){f[1].f[X]=h--;K('if(f[1].f['+X+']-->0)E('+X+');h++;K("E(-9);D()",400)',800)}D()}}
Sj0xNTtTPTMyO289aD0xO1c9W107SD1EYXRlLm5vdztUPUgoKSs2RTQ7Zm9yKGE9MDthPDMxNTspV1thXT0oaT1hL0p8MCkqKGo9YSsrJUopJiYoanxpKSYxJmk8MjAmaisxPEo/MDoxO2Y9W25ldyBDKDE2LDEpLG5ldyBDKCksbmV3IEMoMjk4LDcpXTtRPVsnIzg4OCcsJyM2MzInLCcjMUIxJywncmVkJ107Sz1zZXRUaW1lb3V0O20oKTtmdW5jdGlvbiBEKCl7Zm9yKGEgaW4gVyl7dj1XW2FdPyc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ry, I haven't enougth time to comment my code and invent names for my variables.
The sad truth: My source code looks rougthly like the code above :(, but here one useful discovery
(a+b)%2 is equal to a+b&1
Maybe I will submit the source code leter :)