Classic snake remake. Text based with added hearts ♥♥♥. Use the cursor keys to move up, down, left & right. Enjoy xxx
function F(a){for(i=0;i<36;i++)S+="+";a||(S+="\n+")}function D(){q=o.innerHTML.split(u),r=~~(Math.random()*y.length)-1,q[r]=q[r]==v?w:D(),o.innerHTML=q.join(u)}var R=document.createElement("pre"),h=1,l=3,C=p=0,s=[],w="♥",x="█",v=" ",S=u="";R.style.color="red",b.style.backgroundColor="black",c.style.display="none",onkeydown=function(a){z=a.keyCode,z==38&&(p=-37),z==40&&(p=37),z==37&&(p=-1),z==39&&(p=1)},onload=function(){F();for(i=0;i<21;i++){for(I=0;I<34;I++)i==10&&I==15?S+=x:S+=v;S+="+\n+"}F(1),R.innerHTML=S.substr(0,S.length-1),b.appendChild(R),o=b.children[3],y=o.innerHTML,s.push(y.indexOf(x)),f=s[0],D(),setInterval(function(){C++,B=s[0]+p;if(o.innerHTML[B]==v||o.innerHTML[B]==w){o.innerHTML[B]==w&&(h++,D(),s.push(s[0])),t=s[h];for(i=h;i>0;i--)s[i]=s[i-1];s[0]=s[0]+p,d=o.innerHTML.split(u);for(i=0;i<h;i++)B=s[i],i==0&&h==1&&(d[B-p]=v),i==h-1&&(d[t]=v),d[B]=x,s[i]=B;o.innerHTML=d.join(u)}else if(p!=0){d=o.innerHTML.split(u);for(i=0;i<=h;i++)B=s[i],d[B]=v;o.innerHTML=d.join(u),s[0]=f,p=0,h=1,l--}},150)}
ZnVuY3Rpb24gRihhKXtmb3IoaT0wO2k8MzY7aSsrKVMrPSIrIjthfHwoUys9IlxuKyIpfWZ1bmN0aW9uIEQoKXtxPW8uaW5uZXJIVE1MLnNwbGl0KHUpLHI9fn4oTWF0aC5yYW5kb20oKSp5Lmxlbmd0aCktMSxxW3JdPXFbcl09PXY/dzpEKCksby5pbm5lckhUTUw9cS5qb2luKHUpfXZhciBSPWRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoInByZSIpLGg9MSxsPTMsQz1wPTAscz1bXSx3PSLimaUiLHg9Iu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1, l = 3, C = p = 0,s = [],w='♥',x='█',v=' ',S=u='';
R.style.color='red',b.style.backgroundColor='black',c.style.display='none';
function F(Z){
for (i=0;i<36;i++) S += '+';
if (!Z) S += '\n+';
}
function D(){
q = o.innerHTML.split(u);
r = ~~(Math.random()*y.length)-1;
q[r]=q[r]==v?w:D();
o.innerHTML = q.join(u);
}
onkeydown = function(e){
z = e.keyCode;
if (z == 38) p = -37;
if (z == 40) p = 37;
if (z == 37) p = -1;
if (z == 39) p = 1;
}
onload = function(){
F();
for (i=0;i<21;i++)
{
for (I=0;I<34;I++)
{
if (i==10 && I==15) S+=x;
else S += v;
}
S += '+\n+';
}
F(1);
R.innerHTML = S.substr(0,S.length-1);
b.appendChild(R);
o = b.children[3],y = o.innerHTML;
s.push(y.indexOf(x));
f = s[0];
D();
setInterval(function(){
C++;
B = (s[0]+p);
if (o.innerHTML[B] == v || o.innerHTML[B] == w)
{
if (o.innerHTML[B] == w)
h++,D(),s.push(s[0]);
t = s[h];
for (i=h;i>0;i--)
s[i] = s[i-1];
s[0] = s[0]+p;
d = o.innerHTML.split(u);
for (i=0;i<h;i++)
{
B = (s[i]);
if (i == 0 && h == 1) d[B-p] = v;
if (i == h-1) d[t] = v;
d[B] = x;
s[i] = B;
}
o.innerHTML = d.join(u);
}
else if (p!=0)
{
d = o.innerHTML.split(u);
for (i=0;i<=h;i++)
B = s[i],d[B] = v;
o.innerHTML = d.join(u);
s[0] = f;
p=0;
h=1;
l--;
}
},150)
}