-
Notifications
You must be signed in to change notification settings - Fork 0
/
puyo-cg.html
13 lines (13 loc) · 1.84 KB
/
puyo-cg.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<body id=D onKeyDown=C=event.keyCode><script>A=B=[C=a=b=c=d=e=f=g=h=i=m=
p=0];function F(n){B[n]==p&&p>1?(B[n]=0,m++,F(n-8),F(n+1),F(n+8),F(n-1))
:0}for(M=Math.random;i<104;i++)!(i%8)?A[i]=1:A[i]=i>96||i<8;E();function
E(){for(k="",i=0;i<104;i++)(k+=" ̄■○●◇◆△▲".charAt(A[i])+(!((i+1)%
8)?"■\r":""));D.innerText=k+d;if(!a){j=0;for(i=96;i>17;i--)!A[i]&&A[i-8
]!=0?(A[i]=A[i-8],A[i-8]=0,j=1):0;j?a=0:(a=h=1,f=12,g=4)}if(a==1){for(m=
i=0;i<96;i++)(B=A.slice(0),m=0,p=B[i],F(i),m>3?(e++,d+=m*e,A=B.slice(0),
a=-1):0);!A[12]?a++:a=9}a>3?(e=A[f]=A[g]=0,f+=(C==39)*(!A[f+1])*(!A[g+1]
)-(C==37)*(!A[f-1])*(!A[g-1]),h+=(C>39)*(!A[f+((h+1)%4==1)*-8+((h+1)%4==
2)+((h+1)%4==3)*8-!((h+1)%4)]),g=f-(h%4==1)*8+(h%4==2)+(h%4==3)*8-!(h%4)
,A[f]=b,A[g]=c,C=0,a==8?a=3:a++):0;a==3?(A[f]=A[g]=0,!A[20]?a=9:0,!A[f+8
]&&!A[g+8]?(f+=8,g+=8,a=4):a=0,A[f]=b,A[g]=c):0;if(a==2)(b=2+(M(c=2+(M(A
[f]=b)*6)|0)*6)|0,A[g]=c,a++);if(a<9)setTimeout(E,70)}</script>