A=document.getElementById('c');c=A.getContext('2d');A.width=A.height=450;c.scale(5,5)
U="999999999";Y="996666699";p=l="699999996"+U+Y+Y+"996999999"+Y+U+"696666669"+"6";g=[];T=81;S=0
A.onclick=function(e){l[40]=1;S++};function z(a,b,d,e){c.lineTo(a,b);if(d)z(e,d)};setInterval(function (){
if(!(p=p%10)){for(p=i=0;i<T;i++){g[i]=9;if(l[i]<1)g[i]=0;if(l[i]==6)g[i]=6}for(i=0;i<T;i++)if(l[i]>0&&l[i]<6)
{for(X=r=0;r<4&&r!=9;r++){h=l[i]+r;if(h>4)h-=4;if(h==1&&i%9!=8&&g[i+1]!=6){r=9;X=i+1}if(h==2&&i<72&&g[i+9]!=6){r=9;X=i+9}
if(h==3&&i%9!=0&&g[i-1]!=6){r=9;X=i-1}if(h==4&&i>8&&g[i-9]!=6){r=9;X=i-9}}if (g[X]>0&&g[X]<5){alert("Your score is: "+S);location.reload()}
if (X!=0)g[X]=h}l=g.slice()}else{c.clearRect(0,0,T,T);for(i=0;i<T;i++){t=parseInt(l[i]);u=[0,1,0,-1,0,0,0,0,0,1,0,-1,0,0]
c.save();if(t<7){c.translate(i%9*9+5+u[t]*(p-9),Math.floor(i/9)*9+5+u[t+7]*(p-9));c.rotate(Math.PI/2*t)
c.beginPath();E=-4;c.moveTo(0,E);B=(t==6)?z(4,E,4,4)||z(E,4,E,E):z(4,4,4,E);c.fillStyle="#5"+t+t;c.fill();c.restore()}}}p++},9)
QT1kb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnYycpO2M9QS5nZXRDb250ZXh0KCcyZCcpO0Eud2lkdGg9QS5oZWlnaHQ9NDUwO2Muc2NhbGUoNSw1KQ0KVT0iOTk5OTk5OTk5IjtZPSI5OTY2NjY2OTkiO3A9bD0iNjk5OTk5OTk2IitVK1krWSsiOTk2OTk5OTk5IitZK1UrIjY5NjY2NjY2OSIrIjYiO2c9W107VD04MTtTPTANCkEub25jbGljaz1mdW5jdGlvbihlKXtsWzQwXT0xO1MrK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