SN1KE

febuary 2018

A super tiny demake of LOSSST (my js13kgames 2017 entry) submitted to JS1K 2018

Golfed with xen, xaotic, corruptio, veubeke, subzey & p01

Featuring 55 challenging puzzles!

Goal: try to match the black patterns.

Controls: arrow keys to move / R to reset.

- Github

- Demo

- Commented source code

- making-of

<body id=b>
<script>
b.style.width="48ch";onkeydown=d=e=>{if(!w){z=(f=l<25)?4:l<30?+"75766"[l-25]:l<43?5:6;k=e.which%36,k==16&&d(++l,w=n=0),k<5?(q=p+[,-1,-16,1,16][k],q+=!f&&n&&m(q)>1?[,z,16*z,-z,-16*z][k]:0,n=m(q)<2,s.includes(q)||(s=[p=q,...s])):(n=0,s=[p=81,80]);s.length=l<6?8:l<12?11:l<21?13:f?15:l<30?14:l<43?15:l<48?16:l<52?20:22;w=s.every(p=>!m(p))&&setTimeout`d(++l${500}w=n=0)`;for(B=i="";i<176;i++)B+=`<a style=width:3ch;height:3ch;float:left;background:#${s.includes(i)?w?161:"da6":[111,,777][m(i)]}>${i-p?(i?"":"โ€‚"+(l+1)):"๐Ÿ‘€"}`};b.innerHTML=l<55?B:'<marquee><h1>๐ŸŽ‰ YOU WON ๐ŸŽ‰'};m=p=>(x=p%16)<(t=8-z/2|0)||x>t+z-1||(y=p>>4)<t-2||y>t+z-(f?1:3)?2:!(parseInt("19r,yn,2nn,on,sc,2yc,1aer,3ddj,34v,7pb,327,m48,1egj,ab87,4var,44cc,4v9z,5lye,cdfb,cn3c,1am6,gtjz,9tuf,4wz2,b7cj,1hrdfddq8y,g3t6b,2tc09uicht,1ibkfyb,pesw8s3,jrxo1,9jorj,j7r6m,jio5o,fv5kd,jdyrj,b2lvj,b1asx,jopxb,9luxq,d8473,jnejl,jrkbh,91tgwx,e03aae4,427yw3s,im7v7p,ofbd9ip,46nskug,p2yhnzn,ofaqrjz,1v4x23l,v7krrlr,uq3x8jj,qb2u913".split(",")[l],36)/2**(z*(y-t+2)+(x-t))&1)*(f+1);d(l=w=n=0)
</script>