ByteBeamer / ByteBeamer.github.io

MIT License
1 stars 3 forks source link

add snake #6

Open AdoptMeTradingValues opened 2 years ago

AdoptMeTradingValues commented 2 years ago

here is the code javascript:for(Q=64,m=b=QQ,a=[P=l=u=d=p=S=w=0],u=89,f=(h=j=t=(b+Q)/2)-1,(B=(D=document).body).appendChild(x=D.createElement('p')),(X=x.style).position='fixed',X.left=X.top=0,X.background='#FFF',x.innerHTML='

',v=(s=x.childNodes)[0],(s=s[1]).width=s.height=Q5,c=s.getContext('2d'),onkeydown=onblur=F=function(e,z){z?a[f]?(w+=m,f=Math.random(l+=8)(R=Q-2)R|(u=0),F(f+=Q+1+(f/R|0)2,z)):F(f):e<0?(l?--l:(y=t,t=a[t]-2,F(y)),S+=(w=.8)/4,m=999/(u+++10),a[h+=[-1,-Q,1,Q][d=p]]?B.removeChild(x,alert('Game Over')):(F(h),F(e,j=h),v.innerHTML=P?(setTimeout(F,50,e,0),S|0):'Press P')):-e?(y=(a[e]=e<Q|e>=QQ-Q|!(e%Q)|e%Q==Q-1|(e==h)2)+(e==f),e==h&&(a[j]=2+h),c.fillStyle='hsl('+!a[e]99+','+m2+'%,'+y50+'%)',c.fillRect(e%Q5,(e/Q|0)*5,5,5)):isNaN(y=e.keyCode-37)|y==43?(P=y&&!P)&&F(-1):p=!P|y&-4|!(y^2^d)?p:y;return!1};--b;F(b));void F(-1)

ByteBeamer commented 1 year ago

I'll think about it, I might need better code than that though.