These are chat archives for xem/miniSnake

28th
Jun 2016
Great
Guys, I already have 2 ideas of mini-games to golf during the upcoming weeks. I hope you'll be available :)
(the goal is still to fill a 20-game compilation for js13kgames 2016)
Tommy Hodgins
@tomhodgins
Jun 28 2016 13:07
Is one of them a virtual game of golf?
nope
but they'll bring the total to 19 games, so it you have a 20th idea, I'm interested :)
Tommy Hodgins
@tomhodgins
Jun 28 2016 13:08
a simple MMORPG with persistent online world, with a basic in-game economy?
no, it has to be a mini-game. The 13kb are already almost full
Tommy Hodgins
@tomhodgins
Jun 28 2016 13:09
:P
but you can do that for your individual entry ;)
Mathieu 'p01' Henri
@p01
Jun 28 2016 21:05

230 bytes https://github.com/p01/snake/blob/master/index.html

<pre id=m><script>onkeyup=q=e=>d=e.which&3;setInterval("p+=d&1?d-2:32-d*32;m[q[s-l]]=i=0;I*=!m[q[++s]=p&=I];for(h='\\n.o#​';i<I;m.innerHTML=h+s)h+=h[i++&31&&4]+h[i^(o=p^o?o:s*l++&I)?m[i]|1:m[p]=2]",o=p=83,l=s=d=3,I=511)</script>

facepalm for not thinking about using e.which before

Mathieu 'p01' Henri
@p01
Jun 28 2016 21:20
227 bytes
<pre id=m><script>onkeyup=q=e=>d=e;l=s=setInterval("p+=[32,-1,-32,1][d.which&3];m[q[s-l]]=i=0;I*=!m[q[++s]=p&=I];for(h='\\n.o#​';i<I;m.innerHTML=h+s)h+=h[i++&31&&4]+h[i^(o=p^o?o:s*l++&I)?m[i]|1:m[p]=2]",o=p=83,I=511)</script>
Mathieu 'p01' Henri
@p01
Jun 28 2016 21:44
sorry 227 bytes with fix for length issue when the snake was above the fruit
<pre id=m><script>onkeyup=q=e=>d=e;l=s=setInterval("m[q[s-l]]=i=0;I*=!m[q[++s]=p=p+[32,-1,-32,1][d.which&3]&I];m[p]=2;for(h='\\n.o#​';i<I;m.innerHTML=h+s)h+=h[i++&31&&4]+h[i^(o=p^o?o:s*l++&I)?m[i]|1:2]",o=p=83,I=511)</script>