Play game
Cell Crawler's itch.io pageHow many characters of code did you use?
495
Include your code here, if you'd like to show it off!
<pre><script>o=document;p=o.body.children[0];s=40;S=0;P=0;d=0;D=".";R=n=>parseInt(Math.random()*n);m=o=>{d=D.repeat(s*s).split("").map(n=>R(20)<1?"E":n);d[R(s*s)]="G"};r=o=>p.innerHTML=S+Array.from(d).flatMap((n,m)=>[o=m-P?n:"@",m%s?o:["\n",o]][1]).join(" ");m();r();o.onkeydown=e=>(e=({w:-s,a:-1,s:s,d:1})[e.key])?[d[e=(e+P+s*s)%s**2]==D||d[e]==","?P=e:d[e]=="L"?[P=0,S=0,m()]:0,d=Array.from(d,(n,m)=>n==D&&d[(m+1)%s**2]!=n?",":n=="L"?D:n==","?n="L":n),d[e]=="G"?[P=e,S++,m()]:1,r()]:0</script>
Leave a comment
Log in with itch.io to leave a comment.
Comments
No one has posted a comment yet