Play with arrows, it is something like tron lightcycles race, but with a really dumb opponent.
e=[];q={};wd=a.width;ht=a.height;hs=ht/60;ws=wd/60;k=o=l=f=!1;t=!0;m="gray";c.strokeStyle="silver";for(w=0;w<wd;w+=ws)for(q[~w]={},h=0;h<ht-hs;h+=hs)z={x:w,y:h,r:t,f:1>w||w+2*ws>wd||1>h||h+2*hs>ht?"black":m,d:function(){g=this;g.r&&(c.rect(g.x,g.y,ws,hs),c.fillStyle=g.f,g.r=f)}},e.push(z),q[~w][~h]=z;
function v(d,n){e.push({x:d?ws:wd/2,y:d?hs:ht/2,f:d?"blue":"green",d:function(){p=this;if(!o){if(k){n(p);39==p.k&&(p.x+=ws);37==p.k&&(p.x-=ws);40==p.k&&(p.y+=hs);38==p.k&&(p.y-=hs);try{z=q[~p.x][~p.y],(o=z.f!=m)?(p.f="red",d?alert("Lost"):alert("Won")):(z.f=p.f,z.r=t)}catch(r){}}c.rect(p.x,p.y,ws,hs);c.fillStyle=p.f}}})}v(t,function(d){k&&(d.k=k)});
v(f,function(d){if(k){ts=0;ok=f;l=40-~~(3*Math.random());do{tx=d.x;ty=d.y;39==l&&(tx+=ws);37==l&&(tx-=ws);40==l&&(ty+=hs);38==l&&(ty-=hs);try{z=q[~tx][~ty],ok=z.f==m}catch(n){}ok||(l++,40<l&&(l=37));ts++}while(!ok&&8>ts);d.k=l}});(function dr(){for(i in e)c.beginPath(),e[i].d(),c.fill(),c.stroke();requestAnimationFrame(dr)})();b.onkeydown=function(d){k=d.keyCode};
ZT1bXTtxPXt9O3dkPWEud2lkdGg7aHQ9YS5oZWlnaHQ7aHM9aHQvNjA7d3M9d2QvNjA7az1vPWw9Zj0hMTt0PSEwO209ImdyYXkiO2Muc3Ryb2tlU3R5bGU9InNpbHZlciI7Zm9yKHc9MDt3PHdkO3crPXdzKWZvcihxW353XT17fSxoPTA7aDxodC1ocztoKz1ocyl6PXt4OncseTpoLHI6dCxmOjE+d3x8dysyKndzPndkfHwxPmh8fGgrMipocz5odD8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ua2V5Q29kZX07
e=[],
q={},
wd=a.width,
ht=a.height,
hs=(ht/60),
ws=(wd/60),
k=o=l=f=false,
t=true,
m='gray';
c.strokeStyle='silver';
for(w=0;w<wd;w+=ws) {
q[~w]={};
for(h=0;h<ht-hs;h+=hs) {
z={
x:w,
y:h,
r:t,
f:(w<1||w+ws*2>wd||h<1||h+hs*2>ht)?'black':m,
d:function() {
g=this;
if(!g.r) return;
c.rect(g.x,g.y,ws,hs);
c.fillStyle=g.f;
g.r=f
}
};
e.push(z);
q[~w][~h]=z;
}
}
function v(is,u) {
e.push({
x:is?ws:wd/2,
y:is?hs:ht/2,
f:is?'blue':'green',
d:function(){
p=this;
if(o) return;
if(k) {
u(p);
if(p.k==39) p.x+=ws;
if(p.k==37) p.x-=ws;
if(p.k==40) p.y+=hs;
if(p.k==38) p.y-=hs;
try {
z=q[~p.x][~p.y];
o=z.f!=m;
if(o) {
p.f='red';
if(is) alert("Lost")
else alert("Won")
} else {
z.f=p.f;
z.r=t;
}
} catch(e) {}
}
c.rect(p.x,p.y,ws,hs);
c.fillStyle=p.f;
}
});
};
v(t,function(p){
if(k) {
p.k=k;
}
});
v(f,function(p){
if(!k) return;
ts=0,ok=f,l=40-~~(Math.random()*3);
do {
tx=p.x,ty=p.y;
if(l==39) tx+=ws;
if(l==37) tx-=ws;
if(l==40) ty+=hs;
if(l==38) ty-=hs;
try {
z=q[~tx][~ty];
ok = z.f==m;
}catch(e){}
if(!ok) {
l++;
if(l>40) l=37
}
ts++;
} while(!ok && ts<8)
p.k=l;
});
(function dr(){
for(i in e) {
c.beginPath();
e[i].d();
c.fill();
c.stroke();
}
requestAnimationFrame(dr);
})();
b.onkeydown=function(e) {
k=e.keyCode;
};