Skip to content

Commit

Permalink
even simpler lcg. 353 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
guckstift committed Jun 5, 2023
1 parent 620e2dd commit e2116e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ This way my Snake source code is only 32 lines of HTML+JS code. Yet its a super

There is an even shorter minimalist version in shorter.html without HTML boilerplate => 22 LOC!

Then there is the hand-minified version in min.html. I tried to squeeze out as much bytes as I could => 354 Bytes only
Then there is the hand-minified version in min.html. I tried to squeeze out as much bytes as I could => 353 Bytes only
2 changes: 1 addition & 1 deletion min.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
setInterval(j=>{Y=X&k;s.unshift(h=h+X&15|h+Y&k)
G=i=>(v.fillStyle='#0'+9*s[q](i)+9*(i==a),v.fillRect(i%j*j,i&k,j,j),i&&G(i-1))
onkeydown=e=>X=[Y|j,X%j||15,Y||k,X%j|1][e.which&3]
Q=_=>s[q='includes'](a=a*37+13&z)&&Q()
Q=_=>s[q='includes'](a=a*37+7&z)&&Q()
h-a?s[q](h,1)?s=[h]:s.pop():Q(v=C.getContext('2d'))
G(z)},a,16)"><canvas id=C>

0 comments on commit e2116e5

Please sign in to comment.