wok-current rev 11041
nanchess: Add index.html to nanochess/stuff. Its only 2.2kb. This a fix for slitaz-tank dvd.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sun Oct 16 07:45:56 2011 +0000 (2011-10-16) |
parents | 6bfee44096f0 |
children | f28570fc0263 |
files | nanochess/receipt nanochess/stuff/index.html |
line diff
1.1 --- a/nanochess/receipt Sun Oct 16 07:42:24 2011 +0000 1.2 +++ b/nanochess/receipt Sun Oct 16 07:45:56 2011 +0000 1.3 @@ -11,12 +11,8 @@ 1.4 compile_rules() 1.5 { 1.6 mkdir -p $src 2> /dev/null 1.7 + cp $stuff/index.html $src 1.8 cd $src 1.9 - _TARBALL=toledo_javascript_chess_3.html 1.10 - [ -s ${SOURCE_REPOSITORY:-$SRC}/$_TARBALL ] || 1.11 - wget -P ${SOURCE_REPOSITORY:-$SRC} \ 1.12 - $(dirname $WEB_SITE)/archive/$_TARBALL 1.13 - cp ${SOURCE_REPOSITORY:-$SRC}/$_TARBALL index.html && 1.14 sed -i -e 's/<select/\♟ \→ &/' \ 1.15 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \ 1.16 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/nanochess/stuff/index.html Sun Oct 16 07:45:56 2011 +0000 2.3 @@ -0,0 +1,32 @@ 2.4 +<script>//(c)2010 Oscar Toledo G. 2.5 +var B,i,y,u,b,I=[],G=120,x=10,z=15,M=1e4,l=[5,3,4,6,2,4,3,5,1,1,1,1,1,1,1,1,9,9 2.6 +,9,9,9,9,9,9,13,11,12,14,10,12,11,13,0,99,0,306,297,495,846,-1,0,1,2,2,1,0,-1,- 2.7 +1,1,-10,10,-11,-9,9,11,10,20,-9,-11,-10,-20,-21,-19,-12,-8,8,12,19,21];function 2.8 +X(w,c,h,e,S,s){var t,o,L,E,d,O=e,N=-M*M,K=78-h<<x,p,g,n,m,A,q,r,C,J,a=y?-x:x; 2.9 +y^=8;G++;d=w||s&&s>=h&&X(0,0,0,21,0,0)>M;do{if(o=I[p=O]){q=o&z^y;if(q<7){A=q--& 2.10 +2?8:4;C=o-9&z?[53,47,61,51,47,47][q]:57;do{r=I[p+=l[C]];if(!w|p==w){g=q|p+a-S?0 2.11 +:S;if(!r&(!!q|A<3||!!g)||(r+1&z^y)>9&&q|A>2){if(m=!(r-2&7))return y^=8,I[G--]= 2.12 +O,K;J=n=o&z;E=I[p-a]&z;t=q|E-7?n:(n+=2,6^y);while(n<=t){L=r?l[r&7|32]-h-q:0;if( 2.13 +s)L+=(1-q?l[(p-p%x)/x+37]-l[(O-O%x)/x+37]+l[p%x+38]*(q?1:2)-l[O%x+38]+(o&16)/2: 2.14 +!!m*9)+(!q?!(I[p-1]^n)+!(I[p+1]^n)+l[n&7|32]-99+!!g*99+(A<2):0)+!(E^y^9);if(s>h 2.15 +||1<s&s==h&&L>z|d){I[p]=n,I[O]=m?(I[g]=I[m],I[m]=0):g?I[g]=0:0;L-=X(s>h|d?0:p,L 2.16 +-N,h+1,I[G+1],J=q|A>1?0:p,s);if(!(h||s-1|B-O|i-n|p-b|L<-M))return W(),G--,u=J; 2.17 +J=q-1|A<7||m||!s|d|r|o<z||X(0,0,0,21,0,0)>M;I[O]=o;I[p]=r;m?(I[m]=I[g],I[g]=0): 2.18 +g?I[g]=9^y:0;}if(L>N||s>1&&L==N&&!h&&Math.random()<.5){I[G]=O;if(s>1){if(h&&c-L 2.19 +<0)return y^=8,G--,L;if(!h)i=n,B=O,b=p;}N=L;}n+=J||(g=p,m=p<O?g-3:g+2,I[m]<z|I[ 2.20 +m+O-p]||I[p+=p-O])?1:0;}}}}while(!r&q>2||(p=O,q|A>2|o>z&!r&&++C*--A));}}}while( 2.21 +++O>98?O=20:e-O);return y^=8,G--,N+M*M&&N>-K+1924|d?N:0;}B=i=y=u=0;while(B++< 2.22 +120)I[B-1]=B%x?B/x%x<2|B%x<2?7:B/x&4?0:l[i++]|16:7;for(a= 2.23 +"<table cellspacing=0 align=center>",i=18;i<100;a+=++i%10-9? 2.24 +"<th width=60 height=60 onclick=Y("+i+") id=o"+i+ 2.25 +" style='line-height:50px;font-size:50px;border:2px solid #dde' bgcolor=#"+ 2.26 +(i*.9&1?"c0c":"f0f")+"0f0>":(i++,"<tr>")); 2.27 +a+="<th colspan=8><select id=t style='font-size:20px'><option>♛<option>"; 2.28 +document.write(a+"♜<option>♝<option>♞</select></table>"); 2.29 +function W(){B=b;for(p=21;p<99;++p)if(q=document.getElementById("o"+p)){q. 2.30 +innerHTML="\xa0\u265f\u265a\u265e\u265d\u265c\u265b \u2659\u2654\u2658\u2657\u2656\u2655".charAt(I[p]&z); 2.31 +q.style.borderColor=p==B?"red":"#dde";}}W(); 2.32 +function Y(s){i=(I[s]^y)&z;if(i>8){b=s;W();}else if(B&&i<9){b=s;i=I[B]&z;if((i& 2.33 +7)==1&(b<29|b>90))i=14-document.getElementById("t").selectedIndex^y;X(0,0,0,21, 2.34 +u,1);if(y)setTimeout("X(0,0,0,21,u,2/*ply*/),X(0,0,0,21,u,1)",250);}} 2.35 +</script>