Kaj Björklund
7 years ago
2 changed files with 29 additions and 32 deletions
@ -1,32 +1,30 @@ |
|||||
(function(){'use strict';var aa="pawn knight bishop rook queen king".split(" ");function ba(a,b){return"abcdefgh"[b]+"12345678"[a]}function ca(a){return"abcdefgh".indexOf(a[0])+8*"12345678".indexOf(a[1])}function h(a){return ba(a>>>3,a&7)};function da(a,b){this.a=a>>>0;this.b=b>>>0}function fa(a){a>>>=0;a-=a>>>1&1431655765;a=(a&858993459)+(a>>>2&858993459);return 16843009*(a+(a>>>4)&252645135)>>>24}function ga(a){a>>>=0;return(a&a-1)>>>0}function ha(a){a>>>=0;return fa((a&-a)-1)}function k(a){return fa(a.a)+fa(a.b)}function ia(a){return a.a?ha(a.a):32+ha(a.b)}function p(a){var b=ia(a);a.a?a.a=ga(a.a):a.b=ga(a.b);return b}function q(a){return!a.a&&!a.b}function r(a,b){b>>>=0;return 32>b?!(a.a&1<<b):!(a.b&1<<b-32)} |
|
||||
function s(a,b){b>>>=0;32>b?a.a=(a.a|1<<b)>>>0:a.b=(a.b|1<<b-32)>>>0;return a}function ja(a,b){b>>>=0;32>b?a.a=(a.a&~(1<<b))>>>0:a.b=(a.b&~(1<<b-32))>>>0}function v(a,b){a.a=(a.a&b.a)>>>0;a.b=(a.b&b.b)>>>0;return a}function x(a,b){a.a=(a.a&~b.a)>>>0;a.b=(a.b&~b.b)>>>0;return a}function y(a,b){a.a=(a.a|b.a)>>>0;a.b=(a.b|b.b)>>>0;return a}function ka(a,b){a.a=(a.a^b.a)>>>0;a.b=(a.b^b.b)>>>0}function la(a){a.a=~a.a>>>0;a.b=~a.b>>>0;return a} |
|
||||
function z(a,b){b>>>=0;31<b?(a.b=a.a<<b-32>>>0,a.a=0):0<b&&(a.b=(a.b<<b|a.a>>>32-b)>>>0,a.a=a.a<<b>>>0);return a}function A(a,b){b>>>=0;31<b?(a.a=a.b>>>b-32,a.b=0):0<b&&(a.a=(a.a>>>b|a.b<<32-b)>>>0,a.b>>>=b);return a}function B(a,b){63<b||-63>b?a.a=a.b=0:0<b?z(a,b):0>b&&A(a,-b);return a}function ma(a,b){return a.a===b.a&&a.b===b.b}function C(a){return E(a.a,a.b)}function E(a,b){return new da(a,b)}function F(a){return s(E(0,0),a)} |
|
||||
function na(){var a=oa;return B(v(E(270549120,16909320),B(E(4294967295,4294967295),8*a)),a)}function pa(){var a=qa;return B(v(E(134480385,2151686160),B(E(4294967295,4294967295),8*-a)),a)}function ra(){var a=s(E(0,0),sa),b=x(A(C(a),1),G[7]),d=x(x(A(C(a),2),G[7]),G[6]),c=x(z(C(a),1),G[0]),a=x(x(z(C(a),2),G[0]),G[1]),d=y(d,a),b=y(b,c);return y(y(y(z(C(d),8),A(d,8)),z(C(b),16)),A(b,16))} |
|
||||
function ta(){var a=s(E(0,0),ua),b=y(x(A(C(a),1),G[7]),x(z(C(a),1),G[0])),d=A(y(C(a),b),8),a=z(y(C(a),b),8);return y(y(b,d),a)}for(var va=E(4294967295,4294967295),wa=E(1437226410,1437226410),xa=E(2857740885,2857740885),ya=[],za=0;8>za;++za)ya.push(z(E(16843009,16843009),za));for(var G=ya,I=[],Aa=0;8>Aa;++Aa)I.push(z(E(255,0),8*Aa));for(var Ba=[],oa=-7;8>oa;++oa)Ba.push(na());for(var Ca=[],qa=-7;8>qa;++qa)Ca.push(pa());for(var Da=[],sa=0;64>sa;++sa)Da.push(ra());for(var Ea=[],ua=0;64>ua;++ua)Ea.push(ta());function Fa(a,b){this.b=a>>>0;this.a=b>>>0}for(var Ga=[],Ha=0;1586>Ha;++Ha)Ga.push(1+4294967295*Math.random()>>>0);function J(a,b){a.b=(a.b^Ga[b])>>>0;a.a=(a.a^Ga[b+1])>>>0}function K(a,b){0<=b&&J(a,1570+(b&7))};function L(a,b,d,c,e){this.a=b&63|(a&63)<<6|(d&15)<<12|(c&7)<<16|((e|0)&7)<<19}function M(a){return a.a>>>6&63}function N(a){return a.a>>>12&15}function O(a){return a.a>>>16&7}function Ia(a){return 2===N(a)||3===N(a)}function Ja(a){return N(a)&8?1+(N(a)&3):0}function Ka(a){return 5!==N(a)?a.a&63:(a.a&63)+(M(a)<(a.a&63)?-8:8)} |
|
||||
L.prototype.h=function(){return Ia(this)?"0-0"+(3===N(this)?"-0":""):" NBRQK".charAt(O(this))+h(M(this))+(N(this)&4?"x":"-")+h(this.a&63)+(5===N(this)?"e.p.":"")+(N(this)&8?" NBRQK".charAt(Ja(this)):"")};function P(){this.b=new Fa(0,0);this.a=[y(C(I[1]),I[6]),y(y(y(F(1),F(6)),F(57)),F(62)),y(y(y(F(2),F(5)),F(58)),F(61)),y(y(y(F(0),F(7)),F(56)),F(63)),y(F(3),F(59)),y(F(4),F(60)),y(C(I[0]),I[1]),y(C(I[6]),I[7])];this.f=[];this.c=0;this.e=15;this.d=-1;this.j=0;this.g=[];this.i=[];for(var a=this.f.length=0;64>a;++a){var b;a:{for(b=0;5>=b;++b)if(!r(this.a[b],a))break a;b=null}this.f.push(b)}this.b=new Fa(0,0);this.c&&J(this.b,0);for(a=0;1>=a;++a)for(b=0;5>=b;++b)for(var d=this.b,c=b,e=a,f=Q(this,b,a), |
|
||||
f=C(f);!q(f);){var g=p(f);J(d,2+c+6*e+12*g)}J(this.b,1538+this.e);K(this.b,this.d);this.k=[]}var R=[7,63,0,56],La=[la(z(E(16843009,16843009),7)),va,la(z(E(16843009,16843009),0))];function S(a,b,d){d=Ma(a,!!d);return b?d:d.filter(P.prototype.l,a)}function Q(a,b,d){return v(C(a.a[b]),a.a[6+d])}function Na(a){return y(C(a.a[6]),a.a[7])}function T(a){return Oa(a,a.c^1,ia(Q(a,5,a.c)))}function U(a,b,d,c){var e=E(0,0);d=8*d+c;c=La[1+c];for(B(a,d);!q(v(a,c));B(x(a,b),d))y(e,a);return e} |
|
||||
function Pa(a,b){return y(y(y(U(C(a),b,1,1),U(C(a),b,1,-1)),U(C(a),b,-1,1)),U(C(a),b,-1,-1))}function Sa(a,b){return y(y(y(U(C(a),b,0,1),U(C(a),b,0,-1)),U(C(a),b,1,0)),U(C(a),b,-1,0))} |
|
||||
function Oa(a,b,d){var c,e=Q(a,0,b),f=0===b;c=B(x(C(e),G[0]),f?7:-9);e=B(x(C(e),G[7]),f?9:-7);c=y(c,e);if(!r(c,d))return!0;c=Q(a,1,b);if(!q(v(C(Da[d]),c)))return!0;c=Q(a,5,b);if(!q(v(C(Ea[d]),c)))return!0;c=Na(a);e=Q(a,4,b);f=y(C(Q(a,2,b)),e);f=Pa(f,c);if(!r(f,d))return!0;a=y(C(Q(a,3,b)),e);a=Sa(a,c);return r(a,d)?!1:!0}function V(a,b,d){J(a.b,1538+a.e);a.e&=~(1<<b+(d?0:2));J(a.b,1538+a.e)} |
|
||||
function Ta(a,b,d){if(0===(a.e&1<<b+(d?0:2)))return!1;var c=d?1:-1,e=0===b?4:60,f=Na(a);(c=!r(f,e+c)||!r(f,e+2*c)||!d&&!r(f,e+3*c))||(c=b^1,d=d?1:-1,b=0===b?4:60,c=!(!Oa(a,c,b)&&!Oa(a,c,b+d)&&!Oa(a,c,b+2*d)));return c?!1:!0}function Ua(a){var b=a.b;return 3<=a.k.reduce(function(a,c){return a+(c.b===b.b&&c.a===b.a?1:0)},0)}function Va(a){if(!q(a.a[0])||!q(a.a[3])||!q(a.a[4]))return!1;if(4>k(a.a[6])+k(a.a[7]))return!0;if(!q(a.a[1]))return!1;a=a.a[2];return ma(v(C(a),wa),a)||ma(v(C(a),xa),a)?!0:!1} |
|
||||
function Wa(a){return 100<=a.j||Ua(a)||Va(a)} |
|
||||
function Ma(a,b){function d(a,b,d){for(;!q(a);){var c=p(a);f.push(new L(c-b,c,d,0,D.f[c]))}}function c(a,b,c){d(C(a),b,c?15:11);d(C(a),b,c?14:10);d(C(a),b,c?13:9);d(C(a),b,c?12:8)}function e(a,b,d){for(;!q(b);){var c=p(b);r(ib,c)&&f.push(new L(a,c,r(n,c)?0:4,d,D.f[c]))}}var f=[],g=a.c,n=a.a[6+(g^1)],l=Na(a),D=a,m=1-2*g,w=8*m,u=Q(a,0,g),t=I[g?0:7];if(!b){var H=x(x(B(v(C(u),I[g?6:1]),2*w),l),B(C(l),w));d(H,2*w,1);H=x(B(C(u),w),l);d(x(C(H),t),w,0);c(v(C(H),t),w,!1)}var Qa=G[g?7:0],H=w-m,W=v(B(x(C(u), |
|
||||
Qa),H),n);d(x(C(W),t),H,4);c(v(C(W),t),H,!0);var W=G[g?0:7],w=w+m,Ra=v(B(x(C(u),W),w),n);d(x(C(Ra),t),w,4);c(v(C(Ra),t),w,!0);0<=a.d&&(t=B(x(v(F(a.d+m),u),Qa),H),d(t,H,5),m=B(x(v(F(a.d-m),u),W),w),d(m,w,5));for(var ib=a.a[6+g],m=b?n:va,u=C(Q(a,1,g));!q(u);)t=p(u),e(t,v(C(Da[t]),m),1);for(u=C(Q(a,4,g));!q(u);)t=p(u),e(t,v(y(Pa(F(t),l),Sa(F(t),l)),m),4);for(u=C(Q(a,2,g));!q(u);)t=p(u),e(t,v(Pa(F(t),l),m),2);for(u=C(Q(a,3,g));!q(u);)t=p(u),e(t,v(Sa(F(t),l),m),3);l=ia(Q(a,5,g));e(l,v(C(Ea[l]),m),5);b|| |
|
||||
(Ta(a,g,!0)&&f.push(new L(l,l+2,2,5,null)),Ta(a,g,!1)&&f.push(new L(l,l-2,3,5,null)));return f}function Xa(a,b,d,c,e){var f=y(F(c),F(e));ka(a.a[b],f);ka(a.a[6+d],f);a.f[c]=null;a.f[e]=b;J(a.b,2+b+6*d+12*c);J(a.b,2+b+6*d+12*e)}function Ya(a,b,d,c,e){ja(a.a[b],e);s(a.a[d],e);a.f[e]=d;J(a.b,2+b+6*c+12*e);J(a.b,2+d+6*c+12*e)} |
|
||||
function Za(a,b){if(N(b)&4){var d=b.a>>>19&7,c=a.c^1,e=Ka(b);ja(a.a[d],e);ja(a.a[6+c],e);a.f[e]=null;J(a.b,2+d+6*c+12*e)}Ia(b)&&(d=a.c,c=2===N(b),e=R[d+(c?0:2)],Xa(a,3,d,e,e+(c?-2:3)));Xa(a,O(b),a.c,M(b),b.a&63);N(b)&8&&Ya(a,0,Ja(b),a.c,b.a&63)}function $a(a,b){N(b)&8&&Ya(a,Ja(b),0,a.c,b.a&63);Xa(a,O(b),a.c,b.a&63,M(b));if(Ia(b)){var d=a.c,c=2===N(b),e=R[d+(c?0:2)];Xa(a,3,d,e+(c?-2:3),e)}N(b)&4&&(d=b.a>>>19&7,c=a.c^1,e=Ka(b),s(a.a[d],e),s(a.a[6+c],e),a.f[e]=d,J(a.b,2+d+6*c+12*e))} |
|
||||
P.prototype.l=function(a){Za(this,a);var b=T(this);$a(this,a);return!b};function X(a,b){var d=a.b;a.k.push(new Fa(d.b,d.a));Za(a,b);if(T(a))return $a(a,b),a.k.pop(),!1;a.g.push(b);a.i.push(a.d);a.i.push(a.e);a.i.push(a.j);K(a.b,a.d);a.d=1===N(b)?b.a&63:-1;K(a.b,a.d);d=a.c;5===O(b)?(V(a,d,!0),V(a,d,!1)):3===O(b)&&(M(b)===R[d+0]?V(a,d,!0):M(b)===R[d+2]&&V(a,d,!1));d^=1;3===(b.a>>>19&7)&&(Ka(b)===R[d+0]?V(a,d,!0):Ka(b)===R[d+2]&&V(a,d,!1));N(b)&4||0===O(b)?a.j=0:++a.j;a.c=d;J(a.b,0);return!0} |
|
||||
function Y(a){if(a.g.length){var b=a.g.pop();a.c^=1;J(a.b,0);$a(a,b);a.i.pop();J(a.b,1538+a.e);a.e=a.i.pop();J(a.b,1538+a.e);K(a.b,a.d);a.d=a.i.pop();K(a.b,a.d);a.k.pop()}}P.prototype.h=function(){return this.g.map(function(a){return a.h().trim()}).join(" ")};function ab(a){a=a.replace(/[\r\n\t]/gm," ");for(a=a.replace(/[\u002D\u05BE\u1806\u2010\u2011\u2012\u2013\u2014\u2015\u207B\u208B\u2212\u2E3A\u2E3B\uFE58\uFE63\uFF0D]/g,"-");;){var b=a.replace(/\([^()]*\)/g,"");if(b===a)break;a=b}a=a.replace(/[^ a-z0-9.=:\u00BD-]/gi," ");return a=a.replace(/ +/g," ")} |
|
||||
function bb(a,b){var d=S(a),c=b.match(/0-0(?:-0)?|O-O(?:-O)?/i);if(c){var e=3===c[0].length?2:3;return d.filter(function(a){return N(a)===e})}if(c=b.match(/([NBRQK])?([a-h])?([1-8])?-?([x:])?([a-h])([1-8])?(?:[=(]([NBRQ]))?/)){var f=c[1],g=c[2],n=c[3],l=c[4],D=c[5],m=c[6],w=c[7];return d.filter(function(a){return void 0!==f&&" NBRQK"[O(a)]!==f||void 0===f&&0!==O(a)||void 0!==g&&"abcdefgh"[M(a)&7]!==g||void 0!==n&&"12345678"[M(a)>>>3]!==n||void 0!==l&&!(N(a)&4)||void 0!==D&&"abcdefgh"[a.a&7]!==D|| |
|
||||
void 0!==m&&"12345678"[(a.a&63)>>>3]!==m||void 0!==w&&" NBRQK"[Ja(a)]!==w?!1:!0})}return null}function cb(a){var b=new P;ab(a).split(" ").every(function(a){if(a.match(/\d+\./))return!0;if(a.match(/1-0|0-1|\u00BD-\u00BD/))return!1;var c=bb(b,a);if(!c||1!==c.length)throw Error("Parse error in '"+a+"'");X(b,c[0]);return!0});return b};var db=[100,300,300,500,900,2E4],eb=[[0,0,0,0,0,0,0,0,50,50,50,50,50,50,50,50,10,10,20,30,30,20,10,10,5,5,10,25,25,10,5,5,0,0,0,20,20,0,0,0,5,-5,-10,0,0,-10,-5,5,5,10,10,-20,-20,10,10,5,0,0,0,0,0,0,0,0],[-50,-40,-30,-30,-30,-30,-40,-50,-40,-20,0,0,0,0,-20,-40,-30,0,10,15,15,10,0,-30,-30,5,15,20,20,15,5,-30,-30,0,15,20,20,15,0,-30,-30,5,10,15,15,10,5,-30,-40,-20,0,5,5,0,-20,-40,-50,-40,-30,-30,-30,-30,-40,-50],[-20,-10,-10,-10,-10,-10,-10,-20,-10,0,0,0,0,0,0,-10,-10,0,5,10,10,5,0,-10,-10,5,5,10,10, |
|
||||
|
(function(){var aa="pawn knight bishop rook queen king".split(" ");function ba(a,b){return"abcdefgh"[b]+"12345678"[a]}function ca(a){return"abcdefgh".indexOf(a[0])+8*"12345678".indexOf(a[1])}function g(a){return ba(a>>>3,a&7)};function n(a,b){this.a=a>>>0;this.b=b>>>0}function da(a){a>>>=0;a-=a>>>1&1431655765;a=(a&858993459)+(a>>>2&858993459);return 16843009*(a+(a>>>4)&252645135)>>>24}function ea(a){a>>>=0;return(a&a-1)>>>0}function fa(a){a>>>=0;return da((a&-a)-1)}function p(a){return da(a.a)+da(a.b)}function ha(a){return a.a?fa(a.a):32+fa(a.b)}function t(a){var b=ha(a);a.a?a.a=ea(a.a):a.b=ea(a.b);return b}function u(a){return!a.a&&!a.b}function v(a,b){b>>>=0;return 32>b?!(a.a&1<<b):!(a.b&1<<b-32)} |
||||
|
function w(a,b){b>>>=0;32>b?a.a=(a.a|1<<b)>>>0:a.b=(a.b|1<<b-32)>>>0;return a}function ia(a,b){b>>>=0;32>b?a.a=(a.a&~(1<<b))>>>0:a.b=(a.b&~(1<<b-32))>>>0}n.prototype.and=function(a){this.a=(this.a&a.a)>>>0;this.b=(this.b&a.b)>>>0;return this};function x(a,b){a.a=(a.a&~b.a)>>>0;a.b=(a.b&~b.b)>>>0;return a}n.prototype.or=function(a){this.a=(this.a|a.a)>>>0;this.b=(this.b|a.b)>>>0;return this};n.prototype.xor=function(a){this.a=(this.a^a.a)>>>0;this.b=(this.b^a.b)>>>0;return this}; |
||||
|
function ja(a){a.a=~a.a>>>0;a.b=~a.b>>>0;return a}function y(a,b){b>>>=0;31<b?(a.b=a.a<<b-32>>>0,a.a=0):0<b&&(a.b=(a.b<<b|a.a>>>32-b)>>>0,a.a=a.a<<b>>>0);return a}function z(a,b){b>>>=0;31<b?(a.a=a.b>>>b-32,a.b=0):0<b&&(a.a=(a.a>>>b|a.b<<32-b)>>>0,a.b>>>=b);return a}function A(a,b){63<b||-63>b?a.a=a.b=0:0<b?y(a,b):0>b&&z(a,-b);return a}function ka(a,b){return a.a===b.a&&a.b===b.b}function C(a){return D(a.a,a.b)}function D(a,b){return new n(a,b)}function F(a){return w(D(0,0),a)} |
||||
|
function la(){var a=ma;return A(D(270549120,16909320).and(A(D(4294967295,4294967295),8*a)),a)}function na(){var a=oa;return A(D(134480385,2151686160).and(A(D(4294967295,4294967295),8*-a)),a)}function pa(){var a=w(D(0,0),qa),b=x(z(C(a),1),G[7]),c=x(x(z(C(a),2),G[7]),G[6]),d=x(y(C(a),1),G[0]);a=x(x(y(C(a),2),G[0]),G[1]);c=c.or(a);b=b.or(d);return y(C(c),8).or(z(c,8)).or(y(C(b),16)).or(z(b,16))} |
||||
|
function ra(){var a=w(D(0,0),sa),b=x(z(C(a),1),G[7]).or(x(y(C(a),1),G[0])),c=z(C(a).or(b),8);a=y(C(a).or(b),8);return b.or(c).or(a)}for(var ta=D(4294967295,4294967295),ua=D(1437226410,1437226410),va=D(2857740885,2857740885),wa=[],xa=0;8>xa;++xa)wa.push(y(D(16843009,16843009),xa));for(var G=wa,H=[],ya=0;8>ya;++ya)H.push(y(D(255,0),8*ya));for(var za=[],ma=-7;8>ma;++ma)za.push(la());for(var Aa=[],oa=-7;8>oa;++oa)Aa.push(na());for(var Ba=[],qa=0;64>qa;++qa)Ba.push(pa());for(var Ca=[],sa=0;64>sa;++sa)Ca.push(ra());function Da(a,b){this.b=a>>>0;this.a=b>>>0}for(var Ea=[],Fa=0;1586>Fa;++Fa)Ea.push(1+4294967295*Math.random()>>>0);function I(a,b){a.b=(a.b^Ea[b])>>>0;a.a=(a.a^Ea[b+1])>>>0}function J(a,b){0<=b&&I(a,1570+(b&7))};function L(a,b,c,d,f){this.value=b&63|(a&63)<<6|(c&15)<<12|(d&7)<<16|((f|0)&7)<<19}function M(a){return a.value>>>6&63}function N(a){return a.value>>>12&15}function O(a){return a.value>>>16&7}function P(a){return 2===N(a)||3===N(a)}function Ga(a){return 5!==N(a)?a.value&63:(a.value&63)+(M(a)<(a.value&63)?-8:8)};function Ha(){this.b=new Da(0,0);this.a=[C(H[1]).or(H[6]),F(1).or(F(6)).or(F(57)).or(F(62)),F(2).or(F(5)).or(F(58)).or(F(61)),F(0).or(F(7)).or(F(56)).or(F(63)),F(3).or(F(59)),F(4).or(F(60)),C(H[0]).or(H[1]),C(H[6]).or(H[7])];this.h=[];this.c=0;this.g=15;this.f=-1;this.l=0;this.i=[];this.j=[];for(var a=this.h.length=0;64>a;++a){var b;a:{for(b=0;5>=b;++b)if(!v(this.a[b],a))break a;b=null}this.h.push(b)}this.b=new Da(0,0);this.c&&I(this.b,0);for(a=0;1>=a;++a)for(b=0;5>=b;++b){var c=this.b,d=b,f=a,e= |
||||
|
Q(this,b,a);for(e=C(e);!u(e);){var h=t(e);I(c,2+d+6*f+12*h)}}I(this.b,1538+this.g);J(this.b,this.f);this.m=[]}var R=[7,63,0,56],Ia=[ja(y(D(16843009,16843009),7)),ta,ja(y(D(16843009,16843009),0))];function S(a,b,c){c=Ja(a,!!c);return b?c:c.filter(Ha.prototype.o,a)}function Q(a,b,c){return C(a.a[b]).and(a.a[6+c])}function Ka(a){return C(a.a[6]).or(a.a[7])}function U(a){return La(a,a.c^1,ha(Q(a,5,a.c)))} |
||||
|
function V(a,b,c,d){var f=D(0,0);c=8*c+d;d=Ia[1+d];for(A(a,c);!u(a.and(d));A(x(a,b),c))f.or(a);return f}function Ma(a,b){return V(C(a),b,1,1).or(V(C(a),b,1,-1)).or(V(C(a),b,-1,1)).or(V(C(a),b,-1,-1))}function Pa(a,b){return V(C(a),b,0,1).or(V(C(a),b,0,-1)).or(V(C(a),b,1,0)).or(V(C(a),b,-1,0))} |
||||
|
function La(a,b,c){var d=Q(a,0,b),f=0===b;var e=A(x(C(d),G[0]),f?7:-9);d=A(x(C(d),G[7]),f?9:-7);e=e.or(d);if(!v(e,c))return!0;e=Q(a,1,b);if(!u(C(Ba[c]).and(e)))return!0;e=Q(a,5,b);if(!u(C(Ca[c]).and(e)))return!0;e=Ka(a);d=Q(a,4,b);f=C(Q(a,2,b)).or(d);f=Ma(f,e);if(!v(f,c))return!0;a=C(Q(a,3,b)).or(d);a=Pa(a,e);return v(a,c)?!1:!0}function W(a,b,c){I(a.b,1538+a.g);a.g&=~(1<<b+(c?0:2));I(a.b,1538+a.g)} |
||||
|
function Qa(a,b,c){if(0===(a.g&1<<b+(c?0:2)))return!1;var d=c?1:-1,f=0===b?4:60,e=Ka(a);(d=!v(e,f+d)||!v(e,f+2*d)||!c&&!v(e,f+3*d))||(d=b^1,c=c?1:-1,b=0===b?4:60,d=!(!La(a,d,b)&&!La(a,d,b+c)&&!La(a,d,b+2*c)));return d?!1:!0}function Ra(a){var b=a.b;return 3<=a.m.reduce(function(a,d){return a+(d.b===b.b&&d.a===b.a?1:0)},0)} |
||||
|
function Sa(a){if(!u(a.a[0])||!u(a.a[3])||!u(a.a[4]))return!1;if(4>p(a.a[6])+p(a.a[7]))return!0;if(!u(a.a[1]))return!1;a=a.a[2];return ka(C(a).and(ua),a)||ka(C(a).and(va),a)?!0:!1}function Ta(a){return 100<=a.l||Ra(a)||Sa(a)} |
||||
|
function Ja(a,b){function c(a,b,c){for(;!u(a);){var d=t(a);e.push(new L(d-b,d,c,0,K.h[d]))}}function d(a,b,d){c(C(a),b,d?15:11);c(C(a),b,d?14:10);c(C(a),b,d?13:9);c(C(a),b,d?12:8)}function f(a,b,d){for(;!u(b);){var c=t(b);v(db,c)&&e.push(new L(a,c,v(l,c)?0:4,d,K.h[c]))}}var e=[],h=a.c,l=a.a[6+(h^1)],k=Ka(a),K=a,r=1-2*h,B=8*r,q=Q(a,0,h),m=H[h?0:7];if(!b){var E=x(x(A(C(q).and(H[h?6:1]),2*B),k),A(C(k),B));c(E,2*B,1);E=x(A(C(q),B),k);c(x(C(E),m),B,0);d(C(E).and(m),B,!1)}var Na=G[h?7:0];E=B-r;var T=A(x(C(q), |
||||
|
Na),E).and(l);c(x(C(T),m),E,4);d(C(T).and(m),E,!0);T=G[h?0:7];B+=r;var Oa=A(x(C(q),T),B).and(l);c(x(C(Oa),m),B,4);d(C(Oa).and(m),B,!0);0<=a.f&&(m=A(x(F(a.f+r).and(q),Na),E),c(m,E,5),r=A(x(F(a.f-r).and(q),T),B),c(r,B,5));var db=a.a[6+h];r=b?l:ta;for(q=C(Q(a,1,h));!u(q);)m=t(q),f(m,C(Ba[m]).and(r),1);for(q=C(Q(a,4,h));!u(q);)m=t(q),f(m,Ma(F(m),k).or(Pa(F(m),k)).and(r),4);for(q=C(Q(a,2,h));!u(q);)m=t(q),f(m,Ma(F(m),k).and(r),2);for(q=C(Q(a,3,h));!u(q);)m=t(q),f(m,Pa(F(m),k).and(r),3);k=ha(Q(a,5,h)); |
||||
|
f(k,C(Ca[k]).and(r),5);b||(Qa(a,h,!0)&&e.push(new L(k,k+2,2,5,null)),Qa(a,h,!1)&&e.push(new L(k,k-2,3,5,null)));return e}function Ua(a,b,c,d,f){var e=F(d).or(F(f));a.a[b].xor(e);a.a[6+c].xor(e);a.h[d]=null;a.h[f]=b;I(a.b,2+b+6*c+12*d);I(a.b,2+b+6*c+12*f)}function Va(a,b,c,d,f){ia(a.a[b],f);w(a.a[c],f);a.h[f]=c;I(a.b,2+b+6*d+12*f);I(a.b,2+c+6*d+12*f)} |
||||
|
function Wa(a,b){if(N(b)&4){var c=b.value>>>19&7,d=a.c^1,f=Ga(b);ia(a.a[c],f);ia(a.a[6+d],f);a.h[f]=null;I(a.b,2+c+6*d+12*f)}P(b)&&(c=a.c,d=2===N(b),f=R[c+(d?0:2)],Ua(a,3,c,f,f+(d?-2:3)));Ua(a,O(b),a.c,M(b),b.value&63);N(b)&8&&Va(a,0,N(b)&8?1+(N(b)&3):0,a.c,b.value&63)} |
||||
|
function Xa(a,b){N(b)&8&&Va(a,N(b)&8?1+(N(b)&3):0,0,a.c,b.value&63);Ua(a,O(b),a.c,b.value&63,M(b));if(P(b)){var c=a.c,d=2===N(b),f=R[c+(d?0:2)];Ua(a,3,c,f+(d?-2:3),f)}N(b)&4&&(c=b.value>>>19&7,d=a.c^1,b=Ga(b),w(a.a[c],b),w(a.a[6+d],b),a.h[b]=c,I(a.b,2+c+6*d+12*b))}Ha.prototype.o=function(a){Wa(this,a);var b=U(this);Xa(this,a);return!b}; |
||||
|
function X(a,b){var c=a.b;a.m.push(new Da(c.b,c.a));Wa(a,b);if(U(a))return Xa(a,b),a.m.pop(),!1;a.i.push(b);a.j.push(a.f);a.j.push(a.g);a.j.push(a.l);J(a.b,a.f);a.f=1===N(b)?b.value&63:-1;J(a.b,a.f);c=a.c;5===O(b)?(W(a,c,!0),W(a,c,!1)):3===O(b)&&(M(b)===R[c+0]?W(a,c,!0):M(b)===R[c+2]&&W(a,c,!1));c^=1;3===(b.value>>>19&7)&&(Ga(b)===R[c+0]?W(a,c,!0):Ga(b)===R[c+2]&&W(a,c,!1));N(b)&4||0===O(b)?a.l=0:++a.l;a.c=c;I(a.b,0);return!0} |
||||
|
function Y(a){if(a.i.length){var b=a.i.pop();a.c^=1;I(a.b,0);Xa(a,b);a.j.pop();I(a.b,1538+a.g);a.g=a.j.pop();I(a.b,1538+a.g);J(a.b,a.f);a.f=a.j.pop();J(a.b,a.f);a.m.pop()}};var Ya=[100,300,300,500,900,2E4],Za=[[0,0,0,0,0,0,0,0,50,50,50,50,50,50,50,50,10,10,20,30,30,20,10,10,5,5,10,25,25,10,5,5,0,0,0,20,20,0,0,0,5,-5,-10,0,0,-10,-5,5,5,10,10,-20,-20,10,10,5,0,0,0,0,0,0,0,0],[-50,-40,-30,-30,-30,-30,-40,-50,-40,-20,0,0,0,0,-20,-40,-30,0,10,15,15,10,0,-30,-30,5,15,20,20,15,5,-30,-30,0,15,20,20,15,0,-30,-30,5,10,15,15,10,5,-30,-40,-20,0,5,5,0,-20,-40,-50,-40,-30,-30,-30,-30,-40,-50],[-20,-10,-10,-10,-10,-10,-10,-20,-10,0,0,0,0,0,0,-10,-10,0,5,10,10,5,0,-10,-10,5,5,10,10, |
||||
5,5,-10,-10,0,10,10,10,10,0,-10,-10,10,10,10,10,10,10,-10,-10,5,0,0,0,0,5,-10,-20,-10,-10,-10,-10,-10,-10,-20],[0,0,0,0,0,0,0,0,5,10,10,10,10,10,10,5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,0,0,0,5,5,0,0,0],[-20,-10,-10,-5,-5,-10,-10,-20,-10,0,0,0,0,0,0,-10,-10,0,5,5,5,5,0,-10,-5,0,5,5,5,5,0,-5,0,0,5,5,5,5,0,-5,-10,5,5,5,5,5,0,-10,-10,0,5,0,0,0,0,-10,-20,-10,-10,-5,-5,-10,-10,-20],[-30,-40,-40,-50,-50,-40,-40,-30,-30,-40,-40,-50,-50,-40,-40,-30,-30, |
5,5,-10,-10,0,10,10,10,10,0,-10,-10,10,10,10,10,10,10,-10,-10,5,0,0,0,0,5,-10,-20,-10,-10,-10,-10,-10,-10,-20],[0,0,0,0,0,0,0,0,5,10,10,10,10,10,10,5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,-5,0,0,0,0,0,0,-5,0,0,0,5,5,0,0,0],[-20,-10,-10,-5,-5,-10,-10,-20,-10,0,0,0,0,0,0,-10,-10,0,5,5,5,5,0,-10,-5,0,5,5,5,5,0,-5,0,0,5,5,5,5,0,-5,-10,5,5,5,5,5,0,-10,-10,0,5,0,0,0,0,-10,-20,-10,-10,-5,-5,-10,-10,-20],[-30,-40,-40,-50,-50,-40,-40,-30,-30,-40,-40,-50,-50,-40,-40,-30,-30, |
||||
-40,-40,-50,-50,-40,-40,-30,-30,-40,-40,-50,-50,-40,-40,-30,-20,-30,-30,-40,-40,-30,-30,-20,-10,-20,-20,-20,-20,-20,-20,-10,20,20,0,0,0,0,20,20,20,30,10,0,0,10,30,20]],fb=db[0]/2;function gb(a,b){for(var d=0,c=0;5>c;++c)d+=k(Q(a,c,b))*db[c];1<k(Q(a,2,b))&&(d+=fb);return d}function hb(a,b){for(var d=0,c=0;5>=c;++c)for(var e=C(Q(a,c,b));!q(e);)var f=p(e),d=d+eb[c][b?f:56^f];return d} |
|
||||
function jb(a){function b(a){function b(a){var c=N(a)&4?(1+(a.a>>>19&7))/(1+O(a)):0,c=6*c+O(a),c=16*c+N(a),c=64*c+(a.a&63);return c=64*c+M(a)}a.sort(function(a,c){return b(c)-b(a)});return a}function d(a,c,g){if(Wa(a))return 0;var f,n;n=gb(a,0)-gb(a,1);f=hb(a,0)-hb(a,1);f=n+f;++e;if(n=0===a.c){if(f>=g)return g;c=f>c?f:c}else{if(f<=c)return c;g=f<g?f:g}f=b(S(a,!0,!T(a)));for(var l=0;l<f.length;++l)if(X(a,f[l])){var m=d(a,c,g);Y(a);if(n){if(m>=g)return g;c=m>c?m:c}else{if(m<=c)return c;g=m<g?m:g}}return n? |
|
||||
c:g}function c(a,e,g,f){if(1>e)return d(a,g,f);for(var n=b(S(a,!0,!1)),l=0===a.c,m=!1,D=0;D<n.length;++D)if(X(a,n[D])){var m=!0,ea=c(a,e-1,g,f);Y(a);l?g=ea>g?ea:g:f=ea<f?ea:f;if(f<=g)break}if(!m){if(!T(a))return 0;a=db[5];return l?-a:a}return Wa(a)?0:l?g:f}for(var e=0,f=null,g=-Infinity,n=Infinity,l=b(S(a,!0)),D=0;D<l.length;++D)if(X(a,l[D])){var m=c(a,3,g,n);Y(a);0===a.c?m>g&&(g=m,f=l[D]):m<n&&(n=m,f=l[D])}return f};function kb(){this.a=new P} |
|
||||
function lb(){var a=$("<table>"),b="<tr><th></th>"+"abcdefgh".split("").map(function(a){return'<th class="file">'+a+"</th>"}).join("")+"<th></th></tr>";a.append(b);for(var d=0;8>d;++d){var c=7-d,e=$("<tr>");a.append(e);var f='<th class="rank">'+(8-d)+"</th>";e.append(f);for(var g=0;8>g;++g){var n=$("<td>"),l=(c+g)%2?"light":"dark";n.attr("id",ba(c,g));n.attr("title","Algebraic: "+ba(c,g)+"\nRank: "+c+"\nFile: "+g+"\nIndex: "+(g+8*c)+"\nColor: "+l);n.addClass(l);e.append(n)}e.append(f)}a.append(b);$("#chessboard").append(a)} |
|
||||
function mb(){$("#chessboard table tr td, #chessboard table tr td div").removeClass("from to positional capture double-push en-passant promotion castle king-castle queen-castle")}function nb(){$("#chessboard table tr td div.ui-draggable").draggable("destroy");$("#chessboard table tr td.ui-droppable").droppable("destroy")}function ob(a,b){X(a.a,b);var d="#"+a.a.h().trim();1===a.a.c?window.history.pushState(null,b.h(),d):window.history.replaceState(null,b.h(),d)} |
|
||||
function pb(a){var b=S(a.a);$("#moves").html('<a href="#" id="undo" class="'+(a.a.g.length?"can":"cannot")+'">undo</a><br/><a href="#" id="auto" class="'+(0<b.length?"can":"cannot")+'">auto</a><br/>'+b.map(function(a,b){return'<a href="#" id="'+b+'">'+a.h()+"</a><br/>"}).join(""));$("#chessboard table tr td, #chessboard table tr td div").removeClass("can-move");b.forEach(function(a){a=$("#"+h(M(a)));a.add(a.children()).addClass("can-move")});var d=!1;$("#chessboard table tr td div.can-move").mouseenter(function(){if(!d){var c= |
|
||||
$(this),e=c.parent(),f=ca(""+e.attr("id")),e=e.add(c);e.toggleClass("from",b.some(function(a){return M(a)===f}));e.hasClass("from")&&(b.forEach(function(a){if(M(a)===f){var b=$("#"+h(a.a&63)),b=b.add(b.children());b.addClass("to");b.addClass(0===N(a)?"positional":"");b.addClass(N(a)&4?"capture":"");b.addClass(1===N(a)?"double-push":"");b.addClass(5===N(a)?"en-passant":"");b.addClass(N(a)&8?"promotion":"");b.addClass(Ia(a)?"castle":"");b.addClass(2===N(a)?"king-castle":"");b.addClass(3===N(a)?"queen-castle": |
|
||||
"")}}),nb(),$("#chessboard table tr td.to").droppable({drop:function(){var c=ca(""+$(this).attr("id")),d=b.filter(function(a){return M(a)===f&&(a.a&63)===c});0<d.length?(ob(a,d[0]),Z(a)):(mb(),nb())}}),c.draggable({start:function(){d=!0},stop:function(){d=!1},containment:"#chessboard table",zIndex:10,revert:"invalid"}))}}).mouseleave(function(){d||mb()});$("#moves a").click(function(){var c=$(this).attr("id");"undo"===c?(Y(a.a),Y(a.a),Z(a)):"auto"===c?qb(a):(ob(a,b[parseInt(c,10)]),Z(a))})} |
|
||||
function qb(a){$("#moves").html("");var b=$("#dim");b.fadeIn(function(){var d=jb(a.a);if(!d)throw Error("Move not found");ob(a,d);var c=$("#"+h(M(d))),d=$("#"+h(d.a&63)),e=d.offset().left-c.offset().left,f=d.offset().top-c.offset().top,g=c.children("div");g.css({position:"relative",top:"0px",left:"0px"});b.fadeOut(function(){g.animate({top:f+"px",left:e+"px"},function(){Z(a)})})})} |
|
||||
function Z(a){mb();nb();$("#chessboard table tr td div").remove();$("#chessboard table tr td").removeClass("white black turn last-move "+aa.join(" "));for(var b=a.a.a[6],d=a.a.a[7],c=0;64>c;++c)for(var e=$("#"+h(c)),f=0;5>=f;++f)if(!r(a.a.a[f],c)){var g=0===a.a.c?!r(b,c):!r(d,c),n=$("<div>");n.attr("title",e.attr("title")+"\nPiece: "+aa[f]+"\nColor: "+(r(b,c)?"black":"white"));n.text("\u2659\u265f\u2658\u265e\u2657\u265d\u2656\u265c\u2655\u265b\u2654\u265a".charAt(2*f+(r(b,c)?1:0)));var l=n.add(e); |
|
||||
l.addClass(aa[f]);l.toggleClass("white",!r(b,c));l.toggleClass("black",!r(d,c));l.toggleClass("turn",g);e.append(n);break}b=a.a;b=b.g.length?b.g[b.g.length-1]:null;null!==b&&($("#"+h(M(b))).addClass("last-move"),$("#"+h(b.a&63)).addClass("last-move"));b=a.a;b=S(b).length?100<=b.j?3:Ua(b)?4:Va(b)?5:0:T(b)?1:2;0===b&&1===a.a.c?qb(a):(pb(a),$("#dim").css({display:"none"}),1===b?$("#moves").append("#<br/>"+(a.a.c?"1-0":"0-1")):0!==b&&$("#moves").append("½-½"))} |
|
||||
kb.prototype.b=function(){var a=window.location.href.split("#");this.a=1<a.length?cb(a[1]):new P;Z(this)};window.makeChessGame=function(){lb();var a=new kb;a.b();Z(a);window.onpopstate=a.b.bind(a)};})(); |
|
||||
|
-40,-40,-50,-50,-40,-40,-30,-30,-40,-40,-50,-50,-40,-40,-30,-20,-30,-30,-40,-40,-30,-30,-20,-10,-20,-20,-20,-20,-20,-20,-10,20,20,0,0,0,0,20,20,20,30,10,0,0,10,30,20]],$a=Ya[0]/2;function ab(a,b){for(var c=0,d=0;5>d;++d)c+=p(Q(a,d,b))*Ya[d];1<p(Q(a,2,b))&&(c+=$a);return c}function bb(a,b){for(var c=0,d=0;5>=d;++d)for(var f=C(Q(a,d,b));!u(f);){var e=t(f);c+=Za[d][b?e:56^e]}return c} |
||||
|
function cb(a){function b(a){function b(a){var b=N(a)&4?(1+(a.value>>>19&7))/(1+O(a)):0;b=6*b+O(a);b=16*b+N(a);b=64*b+(a.value&63);return b=64*b+M(a)}a.sort(function(a,c){return b(c)-b(a)});return a}function c(a,d,e){if(Ta(a))return 0;var h=ab(a,0)-ab(a,1);var l=bb(a,0)-bb(a,1);l=h+l;++f;if(h=0===a.c){if(l>=e)return e;d=l>d?l:d}else{if(l<=d)return d;e=l<e?l:e}l=b(S(a,!0,!U(a)));for(var k=0;k<l.length;++k)if(X(a,l[k])){var m=c(a,d,e);Y(a);if(h){if(m>=e)return e;d=m>d?m:d}else{if(m<=d)return d;e=m< |
||||
|
e?m:e}}return h?d:e}function d(a,f,e,h){if(1>f)return c(a,e,h);for(var l=b(S(a,!0,!1)),k=0===a.c,m=!1,r=0;r<l.length;++r)if(X(a,l[r])){m=!0;var q=d(a,f-1,e,h);Y(a);k?e=q>e?q:e:h=q<h?q:h;if(h<=e)break}if(!m){if(!U(a))return 0;a=Ya[5];return k?-a:a}return Ta(a)?0:k?e:h}for(var f=0,e=null,h=-Infinity,l=Infinity,k=b(S(a,!0)),K=0;K<k.length;++K)if(X(a,k[K])){var r=d(a,3,h,l);Y(a);0===a.c?r>h&&(h=r,e=k[K]):r<l&&(l=r,e=k[K])}return e};function eb(){this.a=new Ha} |
||||
|
function fb(){var a=$("<table>"),b="<tr><th></th>"+"abcdefgh".split("").map(function(a){return'<th class="file">'+a+"</th>"}).join("")+"<th></th></tr>";a.append(b);for(var c=0;8>c;++c){var d=7-c,f=$("<tr>");a.append(f);var e='<th class="rank">'+(8-c)+"</th>";f.append(e);for(var h=0;8>h;++h){var l=$("<td>"),k=(d+h)%2?"light":"dark";l.attr("id",ba(d,h));l.attr("title","Algebraic: "+ba(d,h)+"\nRank: "+d+"\nFile: "+h+"\nIndex: "+(h+8*d)+"\nColor: "+k);l.addClass(k);f.append(l)}f.append(e)}a.append(b);$("#chessboard").append(a)} |
||||
|
function gb(){$("#chessboard table tr td, #chessboard table tr td div").removeClass("from to positional capture double-push en-passant promotion castle king-castle queen-castle")}function hb(){$("#chessboard table tr td div.ui-draggable").draggable("destroy");$("#chessboard table tr td.ui-droppable").droppable("destroy")} |
||||
|
function ib(a){var b=S(a.a);$("#moves").html('<a href="#" id="undo" class="'+(a.a.i.length?"can":"cannot")+'">undo</a><br/><a href="#" id="auto" class="'+(0<b.length?"can":"cannot")+'">auto</a><br/>'+b.map(function(a,b){return'<a href="#" id="'+b+'">'+(P(a)?"0-0"+(3===N(a)?"-0":""):" NBRQK".charAt(O(a))+g(M(a))+(N(a)&4?"x":"-")+g(a.value&63)+(5===N(a)?"e.p.":"")+(N(a)&8?" NBRQK".charAt(N(a)&8?1+(N(a)&3):0):""))+"</a><br/>"}).join(""));$("#chessboard table tr td, #chessboard table tr td div").removeClass("can-move"); |
||||
|
b.forEach(function(a){a=$("#"+g(M(a)));a.add(a.children()).addClass("can-move")});var c=!1;$("#chessboard table tr td div.can-move").mouseenter(function(){if(!c){var d=$(this),f=d.parent(),e=ca(""+f.attr("id"));f=f.add(d);f.toggleClass("from",b.some(function(a){return M(a)===e}));f.hasClass("from")&&(b.forEach(function(a){if(M(a)===e){var b=$("#"+g(a.value&63));b=b.add(b.children());b.addClass("to");b.addClass(0===N(a)?"positional":"");b.addClass(N(a)&4?"capture":"");b.addClass(1===N(a)?"double-push": |
||||
|
"");b.addClass(5===N(a)?"en-passant":"");b.addClass(N(a)&8?"promotion":"");b.addClass(P(a)?"castle":"");b.addClass(2===N(a)?"king-castle":"");b.addClass(3===N(a)?"queen-castle":"")}}),hb(),$("#chessboard table tr td.to").droppable({drop:function(){var c=ca(""+$(this).attr("id")),d=b.filter(function(a){return M(a)===e&&(a.value&63)===c});0<d.length?(X(a.a,d[0]),Z(a)):(gb(),hb())}}),d.draggable({start:function(){c=!0},stop:function(){c=!1},containment:"#chessboard table",zIndex:10,revert:"invalid"}))}}).mouseleave(function(){c|| |
||||
|
gb()});$("#moves a").click(function(){var c=$(this).attr("id");"undo"===c?(Y(a.a),Y(a.a),Z(a)):"auto"===c?jb(a):(X(a.a,b[parseInt(c,10)]),Z(a))})} |
||||
|
function jb(a){$("#moves").html("");var b=$("#dim");b.fadeIn(function(){var c=cb(a.a);if(!c)throw Error("Move not found");X(a.a,c);var d=$("#"+g(M(c)));c=$("#"+g(c.value&63));var f=c.offset().left-d.offset().left,e=c.offset().top-d.offset().top,h=d.children("div");h.css({position:"relative",top:"0px",left:"0px"});b.fadeOut(function(){h.animate({top:e+"px",left:f+"px"},function(){Z(a)})})})} |
||||
|
function Z(a){gb();hb();$("#chessboard table tr td div").remove();$("#chessboard table tr td").removeClass("white black turn last-move "+aa.join(" "));for(var b=a.a.a[6],c=a.a.a[7],d=0;64>d;++d)for(var f=$("#"+g(d)),e=0;5>=e;++e)if(!v(a.a.a[e],d)){var h=0===a.a.c?!v(b,d):!v(c,d),l=$("<div>");l.attr("title",f.attr("title")+"\nPiece: "+aa[e]+"\nColor: "+(v(b,d)?"black":"white"));l.text("\u2659\u265f\u2658\u265e\u2657\u265d\u2656\u265c\u2655\u265b\u2654\u265a".charAt(2*e+(v(b,d)?1:0)));var k=l.add(f); |
||||
|
k.addClass(aa[e]);k.toggleClass("white",!v(b,d));k.toggleClass("black",!v(c,d));k.toggleClass("turn",h);f.append(l);break}b=a.a;b=b.i.length?b.i[b.i.length-1]:null;null!==b&&($("#"+g(M(b))).addClass("last-move"),$("#"+g(b.value&63)).addClass("last-move"));b=a.a;b=S(b).length?100<=b.l?3:Ra(b)?4:Sa(b)?5:0:U(b)?1:2;0===b&&1===a.a.c?jb(a):(ib(a),$("#dim").css({display:"none"}),1===b?$("#moves").append("#<br/>"+(a.a.c?"1-0":"0-1")):0!==b&&$("#moves").append("½-½"))};window.makeChessGame=function(){fb();Z(new eb)};})(); |
||||
|
Loading…
Reference in new issue