Browse Source

Remove unused argument from Move/getCapturedPiece

Detected by the latest version of Google Closure Compiler.
master
Kaj Björklund 11 years ago
parent
commit
ccf4a0ed3e
  1. 11
      chess.html
  2. 59
      chess.min.js
  3. 2
      src/move.js

11
chess.html

@ -4,7 +4,7 @@
<meta http-equiv="x-ua-compatible" content="IE=edge">
<meta charset="utf-8">
<title>Chess</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css">
<link rel="stylesheet" href="chess.css">
<link rel="shortcut icon" href="chess.ico">
</head>
@ -24,13 +24,14 @@
</div>
<div id="footer"></div>
<div id="dim"></div>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min.js"></script>
<!--[if lt IE 9]><script src="http://cdnjs.cloudflare.com/ajax/libs/augment.js/1.0.0/augment.min.js"></script><![endif]-->
<script src="//code.jquery.com/jquery-1.9.0.min.js"></script>
<script src="//code.jquery.com/ui/1.10.0/jquery-ui.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min.js"></script>
<!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/augment.js/1.0.0/augment.min.js"></script><![endif]-->
<script src="chess.min.js"></script>
<script>
$(makeChessGame);
</script>
<a href="https://github.com/kbjorklu/chess"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
</body>
</html>

59
chess.min.js

@ -1,29 +1,32 @@
(function(){'use strict';var f=!0,j=null,m=!1,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 q(a){return ba(a>>>3,a&7)};function da(a,b){this.a=a>>>0;this.b=b>>>0}function ea(a){a>>>=0;a-=a>>>1&1431655765;a=(a&858993459)+(a>>>2&858993459);return 16843009*(a+(a>>>4)&252645135)>>>24}function fa(a){a>>>=0;return(a&a-1)>>>0}function ga(a){a>>>=0;return ea((a&-a)-1)}function r(a){return ea(a.a)+ea(a.b)}function ha(a){return a.a?ga(a.a):32+ga(a.b)}function s(a){var b=ha(a);a.a?a.a=fa(a.a):a.b=fa(a.b);return b}function t(a){return!a.a&&!a.b}function u(a,b){b>>>=0;return 32>b?!(a.a&1<<b):!(a.b&1<<b-32)}
function ia(a,b){return!u(a,b)}function y(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 A(a,b){a.a=(a.a&b.a)>>>0;a.b=(a.b&b.b)>>>0;return a}function B(a,b){a.a=(a.a&~b.a)>>>0;a.b=(a.b&~b.b)>>>0;return a}function C(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 D(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 E(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 F(a,b){63<b||-63>b?a.a=a.b=0:0<b?D(a,b):0>b&&E(a,-b);return a}function ma(a,b){return a.a===b.a&&a.b===b.b}function G(a){return I(a.a,a.b)}function I(a,b){return new da(a,b)}function J(a){return y(I(0,0),a)}
function na(){var a=oa;return F(A(I(270549120,16909320),F(I(4294967295,4294967295),8*a)),a)}function pa(){var a=qa;return F(A(I(134480385,2151686160),F(I(4294967295,4294967295),8*-a)),a)}function ra(){var a=y(I(0,0),sa),b=B(E(G(a),1),K[7]),c=B(B(E(G(a),2),K[7]),K[6]),d=B(D(G(a),1),K[0]),a=B(B(D(G(a),2),K[0]),K[1]),c=C(c,a),b=C(b,d);return C(C(C(D(G(c),8),E(c,8)),D(G(b),16)),E(b,16))}
function ta(){var a=y(I(0,0),ua),b=C(B(E(G(a),1),K[7]),B(D(G(a),1),K[0])),c=E(C(G(a),b),8),a=D(C(G(a),b),8);return C(C(b,c),a)}for(var va=I(4294967295,4294967295),wa=I(1437226410,1437226410),xa=I(2857740885,2857740885),ya=[],za=0;8>za;++za)ya.push(D(I(16843009,16843009),za));for(var K=ya,L=[],Aa=0;8>Aa;++Aa)L.push(D(I(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 M(a,b){a.b=(a.b^Ga[b])>>>0;a.a=(a.a^Ga[b+1])>>>0}function N(a,b){0<=b&&M(a,1570+(b&7))};function Ia(a,b,c,d,g){this.a=b&63|(a&63)<<6|(c&15)<<12|(d&7)<<16|((g|0)&7)<<19}function O(a){return a.a>>>6&63}function P(a){return a.a>>>12&15}function Q(a){return a.a>>>16&7}function Ja(a){return 2===P(a)||3===P(a)}function Ka(a){return 5!==P(a)?a.a&63:(a.a&63)+(O(a)<(a.a&63)?-8:8)}function La(a){return!Ja(a)?" NBRQK".charAt(Q(a))+q(O(a))+(P(a)&4?"x":"-")+q(a.a&63)+(5===P(a)?"e.p.":"")+(P(a)&8?" NBRQK".charAt(P(a)&8?1+(P(a)&3):0):""):"0-0"+(3===P(a)?"-0":"")};function Ma(){this.b=new Fa(0,0);this.a=[C(G(L[1]),L[6]),C(C(C(J(1),J(6)),J(57)),J(62)),C(C(C(J(2),J(5)),J(58)),J(61)),C(C(C(J(0),J(7)),J(56)),J(63)),C(J(3),J(59)),C(J(4),J(60)),C(G(L[0]),L[1]),C(G(L[6]),L[7])];this.f=[];this.c=0;this.e=15;this.d=-1;this.h=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(!u(this.a[b],a))break a;b=j}this.f.push(b)}this.b=new Fa(0,0);this.c&&M(this.b,0);for(a=0;1>=a;++a)for(b=0;5>=b;++b)for(var c=this.b,d=b,g=a,e=R(this,b,a),e=
G(e);!t(e);){var h=s(e);M(c,2+d+6*g+12*h)}M(this.b,1538+this.e);N(this.b,this.d);this.j=[]}var S=[7,63,0,56],Na=[la(D(I(16843009,16843009),7)),va,la(D(I(16843009,16843009),0))];
function T(a,b,c){function d(a,b,c){for(;!t(b);){var d=s(b);u(jb,d)&&h.push(new Ia(a,d,!u(v,d)?4:0,c,H.f[d]))}}function g(a,b,c){e(G(a),b,c?15:11);e(G(a),b,c?14:10);e(G(a),b,c?13:9);e(G(a),b,c?12:8)}function e(a,b,c){for(;!t(a);){var d=s(a);h.push(new Ia(d-b,d,c,0,H.f[d]))}}c=!!c;var h=[],k=a.c,v=a.a[6+(k^1)],l=U(a),H=a,n=1-2*k,x=8*n,w=R(a,0,k),p=L[k?0:7];if(!c){var z=B(B(F(A(G(w),L[k?6:1]),2*x),l),F(G(l),x));e(z,2*x,1);z=B(F(G(w),x),l);e(B(G(z),p),x,0);g(A(G(z),p),x,m)}var Sa=K[k?7:0],z=x-n,Y=A(F(B(G(w),
Sa),z),v);e(B(G(Y),p),z,4);g(A(G(Y),p),z,f);var Y=K[k?0:7],x=x+n,Ta=A(F(B(G(w),Y),x),v);e(B(G(Ta),p),x,4);g(A(G(Ta),p),x,f);0<=a.d&&(p=F(B(A(J(a.d+n),w),Sa),z),e(p,z,5),n=F(B(A(J(a.d-n),w),Y),x),e(n,x,5));for(var jb=a.a[6+k],n=c?v:va,w=G(R(a,1,k));!t(w);)p=s(w),d(p,A(G(Da[p]),n),1);for(w=G(R(a,4,k));!t(w);)p=s(w),d(p,A(C(Oa(J(p),l),Pa(J(p),l)),n),4);for(w=G(R(a,2,k));!t(w);)p=s(w),d(p,A(Oa(J(p),l),n),2);for(w=G(R(a,3,k));!t(w);)p=s(w),d(p,A(Pa(J(p),l),n),3);l=ha(R(a,5,k));d(l,A(G(Ea[l]),n),5);c||
(Qa(a,k,f)&&h.push(new Ia(l,l+2,2,5,j)),Qa(a,k,m)&&h.push(new Ia(l,l-2,3,5,j)));c=h;return b?c:c.filter(Ma.prototype.k,a)}function R(a,b,c){return A(G(a.a[b]),a.a[6+c])}function U(a){return C(G(a.a[6]),a.a[7])}function V(a){return Ra(a,a.c^1,ha(R(a,5,a.c)))}function Ua(a,b){var c=0===a,d=F(B(G(b),K[0]),c?7:-9),c=F(B(G(b),K[7]),c?9:-7);return C(d,c)}function W(a,b,c,d){var g=I(0,0);c=8*c+d;d=Na[1+d];for(F(a,c);!t(A(a,d));F(B(a,b),c))C(g,a);return g}
function Oa(a,b){return C(C(C(W(G(a),b,1,1),W(G(a),b,1,-1)),W(G(a),b,-1,1)),W(G(a),b,-1,-1))}function Pa(a,b){return C(C(C(W(G(a),b,0,1),W(G(a),b,0,-1)),W(G(a),b,1,0)),W(G(a),b,-1,0))}function Ra(a,b,c){var d=R(a,0,b);if(ia(Ua(b,d),c))return f;d=R(a,1,b);if(!t(A(G(Da[c]),d)))return f;d=R(a,5,b);if(!t(A(G(Ea[c]),d)))return f;var d=U(a),g=R(a,4,b),e=C(G(R(a,2,b)),g);if(ia(Oa(e,d),c))return f;a=C(G(R(a,3,b)),g);return ia(Pa(a,d),c)?f:m}
function X(a,b,c){M(a.b,1538+a.e);a.e&=~(1<<b+(c?0:2));M(a.b,1538+a.e)}function Qa(a,b,c){if(0===(a.e&1<<b+(c?0:2)))return m;var d=c?1:-1,g=0===b?4:60,e=U(a);if(!(d=!u(e,g+d)||!u(e,g+2*d)||!c&&!u(e,g+3*d)))d=b^1,c=c?1:-1,b=0===b?4:60,d=!(!Ra(a,d,b)&&!Ra(a,d,b+c)&&!Ra(a,d,b+2*c));return d?m:f}function Va(a){var b=a.b;return 3<=a.j.reduce(function(a,d){return a+(d.b===b.b&&d.a===b.a?1:0)},0)}
function Wa(a){if(!t(a.a[0])||!t(a.a[3])||!t(a.a[4]))return m;if(4>r(a.a[6])+r(a.a[7]))return f;if(!t(a.a[1]))return m;a=a.a[2];return ma(A(G(a),wa),a)||ma(A(G(a),xa),a)?f:m}function Xa(a,b,c,d,g){var e=C(J(d),J(g));ka(a.a[b],e);ka(a.a[6+c],e);a.f[d]=j;a.f[g]=b;M(a.b,2+b+6*c+12*d);M(a.b,2+b+6*c+12*g)}function Ya(a,b,c,d,g){ja(a.a[b],g);y(a.a[c],g);a.f[g]=c;M(a.b,2+b+6*d+12*g);M(a.b,2+c+6*d+12*g)}
function Za(a,b){if(P(b)&4){var c=b.a>>>19&7,d=a.c^1,g=Ka(b);ja(a.a[c],g);ja(a.a[6+d],g);a.f[g]=j;M(a.b,2+c+6*d+12*g)}Ja(b)&&(c=a.c,d=2===P(b),g=S[c+(d?0:2)],Xa(a,3,c,g,g+(d?-2:3)));Xa(a,Q(b),a.c,O(b),b.a&63);P(b)&8&&Ya(a,0,P(b)&8?1+(P(b)&3):0,a.c,b.a&63)}
function $a(a,b){P(b)&8&&Ya(a,P(b)&8?1+(P(b)&3):0,0,a.c,b.a&63);Xa(a,Q(b),a.c,b.a&63,O(b));if(Ja(b)){var c=a.c,d=2===P(b),g=S[c+(d?0:2)];Xa(a,3,c,g+(d?-2:3),g)}P(b)&4&&(c=b.a>>>19&7,d=a.c^1,g=Ka(b),y(a.a[c],g),y(a.a[6+d],g),a.f[g]=c,M(a.b,2+c+6*d+12*g))}Ma.prototype.k=function(a){Za(this,a);var b=V(this);$a(this,a);return!b};
function Z(a,b){a.j.push(new Fa(a.b.b,a.b.a));Za(a,b);if(V(a))return $a(a,b),a.j.pop(),m;a.g.push(b);a.i.push(a.d);a.i.push(a.e);a.i.push(a.h);N(a.b,a.d);a.d=1===P(b)?b.a&63:-1;N(a.b,a.d);var c=a.c;5===Q(b)?(X(a,c,f),X(a,c,m)):3===Q(b)&&(O(b)===S[c+0]?X(a,c,f):O(b)===S[c+2]&&X(a,c,m));c^=1;3===(b.a>>>19&7)&&(Ka(b)===S[c+0]?X(a,c,f):Ka(b)===S[c+2]&&X(a,c,m));P(b)&4||0===Q(b)?a.h=0:++a.h;a.c=c;M(a.b,0);return f}
function ab(a){if(a.g.length){var b=a.g.pop();a.c^=1;M(a.b,0);$a(a,b);a.i.pop();M(a.b,1538+a.e);a.e=a.i.pop();M(a.b,1538+a.e);N(a.b,a.d);a.d=a.i.pop();N(a.b,a.d);a.j.pop()}};var bb=[100,300,300,500,900,2E4],cb=[[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(){'use strict';var h=0,k=5,p=0,ba="pawn knight bishop rook queen king".split(" ");function ca(a,b){return"abcdefgh"[b]+"12345678"[a]}function da(a){return"abcdefgh".indexOf(a[0])+8*"12345678".indexOf(a[1])}function q(a){return ca(a>>>3,a&7)};function ea(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 r(a){return fa(a.a)+fa(a.b)}function ia(a){return a.a?ha(a.a):32+ha(a.b)}function s(a){var b=ia(a);a.a?a.a=ga(a.a):a.b=ga(a.b);return b}function t(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 ja(a,b){return!v(a,b)}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 ka(a,b){b>>>=0;32>b?a.a=(a.a&~(1<<b))>>>0:a.b=(a.b&~(1<<b-32))>>>0}function y(a,b){a.a=(a.a&b.a)>>>0;a.b=(a.b&b.b)>>>0;return a}function A(a,b){a.a=(a.a&~b.a)>>>0;a.b=(a.b&~b.b)>>>0;return a}function B(a,b){a.a=(a.a|b.a)>>>0;a.b=(a.b|b.b)>>>0;return a}function la(a,b){a.a=(a.a^b.a)>>>0;a.b=(a.b^b.b)>>>0}function na(a){a.a=~a.a>>>0;a.b=~a.b>>>0;return a}
function C(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 D(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 E(a,b){63<b||-63>b?a.a=a.b=0:0<b?C(a,b):0>b&&D(a,-b);return a}function oa(a,b){return a.a===b.a&&a.b===b.b}function F(a){return H(a.a,a.b)}function H(a,b){return new ea(a,b)}function I(a){return w(H(0,0),a)}
function pa(){var a=qa;return E(y(H(270549120,16909320),E(H(4294967295,4294967295),8*a)),a)}function ra(){var a=sa;return E(y(H(134480385,2151686160),E(H(4294967295,4294967295),8*-a)),a)}function ta(){var a=w(H(0,0),ua),b=A(D(F(a),1),J[7]),c=A(A(D(F(a),2),J[7]),J[6]),d=A(C(F(a),1),J[0]),a=A(A(C(F(a),2),J[0]),J[1]),c=B(c,a),b=B(b,d);return B(B(B(C(F(c),8),D(c,8)),C(F(b),16)),D(b,16))}
function va(){var a=w(H(0,0),wa),b=B(A(D(F(a),1),J[7]),A(C(F(a),1),J[0])),c=D(B(F(a),b),8),a=C(B(F(a),b),8);return B(B(b,c),a)}for(var xa=H(4294967295,4294967295),ya=H(1437226410,1437226410),za=H(2857740885,2857740885),Aa=[],Ba=0;8>Ba;++Ba)Aa.push(C(H(16843009,16843009),Ba));for(var J=Aa,K=[],Ca=0;8>Ca;++Ca)K.push(C(H(255,0),8*Ca));for(var Da=[],qa=-7;8>qa;++qa)Da.push(pa());for(var Ea=[],sa=-7;8>sa;++sa)Ea.push(ra());for(var Fa=[],ua=0;64>ua;++ua)Fa.push(ta());for(var Ga=[],wa=0;64>wa;++wa)Ga.push(va());function Ha(a,b){this.b=a>>>0;this.a=b>>>0}for(var Ia=[],Ja=0;1586>Ja;++Ja)Ia.push(1+4294967295*Math.random()>>>0);function L(a,b){a.b=(a.b^Ia[b])>>>0;a.a=(a.a^Ia[b+1])>>>0}function N(a,b){0<=b&&L(a,1570+(b&7))};function Ka(a,b,c,d,e){this.a=b&63|(a&63)<<6|(c&15)<<12|(d&7)<<16|((e|0)&7)<<19}var La=0,Ma=4,Na=8,Oa=9,Pa=10,Qa=11,Ra=12,Sa=13,Ta=14,Ua=15;function O(a){return a.a>>>6&63}function P(a){return a.a>>>12&15}function Q(a){return a.a>>>16&7}function Va(a){return 2===P(a)||3===P(a)}function Wa(a){return P(a)&8?1+(P(a)&3):h}function Xa(a){return 5!==P(a)?a.a&63:(a.a&63)+(O(a)<(a.a&63)?-8:8)}
function Ya(a){return Va(a)?"0-0"+(3===P(a)?"-0":""):" NBRQK".charAt(Q(a))+q(O(a))+(P(a)&4?"x":"-")+q(a.a&63)+(5===P(a)?"e.p.":"")+(P(a)&8?" NBRQK".charAt(Wa(a)):"")};function ab(){this.b=new Ha(0,0);this.a=[B(F(K[1]),K[6]),B(B(B(I(1),I(6)),I(57)),I(62)),B(B(B(I(2),I(5)),I(58)),I(61)),B(B(B(I(0),I(7)),I(56)),I(63)),B(I(3),I(59)),B(I(4),I(60)),B(F(K[0]),K[1]),B(F(K[6]),K[7])];this.f=[];this.c=p;this.e=15;this.d=-1;this.h=0;this.g=[];this.i=[];for(var a=this.f.length=0;64>a;++a){var b;a:{for(b=h;b<=k;++b)if(!v(this.a[b],a))break a;b=null}this.f.push(b)}this.b=new Ha(0,0);this.c&&L(this.b,0);for(a=p;1>=a;++a)for(b=h;b<=k;++b)for(var c=this.b,d=b,e=a,f=R(this,b,a),
f=F(f);!t(f);){var g=s(f);L(c,2+d+6*e+12*g)}L(this.b,1538+this.e);N(this.b,this.d);this.j=[]}var S=k+1,bb=S+1,T=[7,63,0,56],cb=[na(C(H(16843009,16843009),7)),xa,na(C(H(16843009,16843009),0))];function U(a,b,c){c=db(a,!!c);return b?c:c.filter(ab.prototype.k,a)}function R(a,b,c){return y(F(a.a[b]),a.a[S+c])}function V(a){return B(F(a.a[S]),a.a[bb])}function W(a){return eb(a,a.c^1,ia(R(a,k,a.c)))}function fb(a,b){var c=a===p,d=E(A(F(b),J[0]),c?7:-9),c=E(A(F(b),J[7]),c?9:-7);return B(d,c)}
function X(a,b,c,d){var e=H(0,0);c=8*c+d;d=cb[1+d];for(E(a,c);!t(y(a,d));E(A(a,b),c))B(e,a);return e}function gb(a,b){return B(B(B(X(F(a),b,1,1),X(F(a),b,1,-1)),X(F(a),b,-1,1)),X(F(a),b,-1,-1))}function hb(a,b){return B(B(B(X(F(a),b,0,1),X(F(a),b,0,-1)),X(F(a),b,1,0)),X(F(a),b,-1,0))}
function eb(a,b,c){var d=R(a,h,b);if(ja(fb(b,d),c))return!0;d=R(a,1,b);if(!t(y(F(Fa[c]),d)))return!0;d=R(a,k,b);if(!t(y(F(Ga[c]),d)))return!0;var d=V(a),e=R(a,4,b),f=B(F(R(a,2,b)),e);if(ja(gb(f,d),c))return!0;a=B(F(R(a,3,b)),e);return ja(hb(a,d),c)?!0:!1}function Y(a,b,c){L(a.b,1538+a.e);a.e&=~(1<<b+(c?0:2));L(a.b,1538+a.e)}
function ib(a,b,c){if(0===(a.e&1<<b+(c?0:2)))return!1;var d=c?1:-1,e=b===p?4:60,f=V(a);(d=!v(f,e+d)||!v(f,e+2*d)||!c&&!v(f,e+3*d))||(d=b^1,c=c?1:-1,b=b===p?4:60,d=!(!eb(a,d,b)&&!eb(a,d,b+c)&&!eb(a,d,b+2*c)));return d?!1:!0}function jb(a){var b=a.b;return 3<=a.j.reduce(function(a,d){return a+(d.b===b.b&&d.a===b.a?1:0)},0)}
function kb(a){if(!t(a.a[h])||!t(a.a[3])||!t(a.a[4]))return!1;if(4>r(a.a[S+p])+r(a.a[S+1]))return!0;if(!t(a.a[1]))return!1;a=a.a[2];return oa(y(F(a),ya),a)||oa(y(F(a),za),a)?!0:!1}
function db(a,b){function c(a,b,c){for(;!t(a);){var d=s(a);f.push(new Ka(d-b,d,c,h,z.f[d]))}}function d(a,b,d){c(F(a),b,d?Ua:Qa);c(F(a),b,d?Ta:Pa);c(F(a),b,d?Sa:Oa);c(F(a),b,d?Ra:Na)}function e(a,b,c){for(;!t(b);){var d=s(b);v(yb,d)&&f.push(new Ka(a,d,v(m,d)?La:Ma,c,z.f[d]))}}var f=[],g=a.c,m=a.a[S+(g^1)],l=V(a),z=a,n=1-2*g,G=8*n,x=R(a,h,g),u=K[g?0:7];if(!b){var M=A(A(E(y(F(x),K[g?6:1]),2*G),l),E(F(l),G));c(M,2*G,1);M=A(E(F(x),G),l);c(A(F(M),u),G,La);d(y(F(M),u),G,!1)}var Za=J[g?7:0],M=G-n,aa=y(E(A(F(x),
Za),M),m);c(A(F(aa),u),M,Ma);d(y(F(aa),u),M,!0);var aa=J[g?0:7],G=G+n,$a=y(E(A(F(x),aa),G),m);c(A(F($a),u),G,Ma);d(y(F($a),u),G,!0);0<=a.d&&(u=E(A(y(I(a.d+n),x),Za),M),c(u,M,5),n=E(A(y(I(a.d-n),x),aa),G),c(n,G,5));for(var yb=a.a[S+g],n=b?m:xa,x=F(R(a,1,g));!t(x);)u=s(x),e(u,y(F(Fa[u]),n),1);for(x=F(R(a,4,g));!t(x);)u=s(x),e(u,y(B(gb(I(u),l),hb(I(u),l)),n),4);for(x=F(R(a,2,g));!t(x);)u=s(x),e(u,y(gb(I(u),l),n),2);for(x=F(R(a,3,g));!t(x);)u=s(x),e(u,y(hb(I(u),l),n),3);l=ia(R(a,k,g));e(l,y(F(Ga[l]),
n),k);b||(ib(a,g,!0)&&f.push(new Ka(l,l+2,2,k,null)),ib(a,g,!1)&&f.push(new Ka(l,l-2,3,k,null)));return f}function lb(a,b,c,d,e){var f=B(I(d),I(e));la(a.a[b],f);la(a.a[S+c],f);a.f[d]=null;a.f[e]=b;L(a.b,2+b+6*c+12*d);L(a.b,2+b+6*c+12*e)}function mb(a,b,c,d,e){ka(a.a[b],e);w(a.a[c],e);a.f[e]=c;L(a.b,2+b+6*d+12*e);L(a.b,2+c+6*d+12*e)}
function nb(a,b){if(P(b)&4){var c=b.a>>>19&7,d=a.c^1,e=Xa(b);ka(a.a[c],e);ka(a.a[S+d],e);a.f[e]=null;L(a.b,2+c+6*d+12*e)}Va(b)&&(c=a.c,d=2===P(b),e=T[c+(d?0:2)],lb(a,3,c,e,e+(d?-2:3)));lb(a,Q(b),a.c,O(b),b.a&63);P(b)&8&&mb(a,h,Wa(b),a.c,b.a&63)}function ob(a,b){P(b)&8&&mb(a,Wa(b),h,a.c,b.a&63);lb(a,Q(b),a.c,b.a&63,O(b));if(Va(b)){var c=a.c,d=2===P(b),e=T[c+(d?0:2)];lb(a,3,c,e+(d?-2:3),e)}P(b)&4&&(c=b.a>>>19&7,d=a.c^1,e=Xa(b),w(a.a[c],e),w(a.a[S+d],e),a.f[e]=c,L(a.b,2+c+6*d+12*e))}
ab.prototype.k=function(a){nb(this,a);var b=W(this);ob(this,a);return!b};function Z(a,b){a.j.push(new Ha(a.b.b,a.b.a));nb(a,b);if(W(a))return ob(a,b),a.j.pop(),!1;a.g.push(b);a.i.push(a.d);a.i.push(a.e);a.i.push(a.h);N(a.b,a.d);a.d=1===P(b)?b.a&63:-1;N(a.b,a.d);var c=a.c;Q(b)===k?(Y(a,c,!0),Y(a,c,!1)):3===Q(b)&&(O(b)===T[c+0]?Y(a,c,!0):O(b)===T[c+2]&&Y(a,c,!1));c^=1;3===(b.a>>>19&7)&&(Xa(b)===T[c+0]?Y(a,c,!0):Xa(b)===T[c+2]&&Y(a,c,!1));P(b)&4||Q(b)===h?a.h=0:++a.h;a.c=c;L(a.b,0);return!0}
function pb(a){if(a.g.length){var b=a.g.pop();a.c^=1;L(a.b,0);ob(a,b);a.i.pop();L(a.b,1538+a.e);a.e=a.i.pop();L(a.b,1538+a.e);N(a.b,a.d);a.d=a.i.pop();N(a.b,a.d);a.j.pop()}};var qb=[100,300,300,500,900,2E4],rb=[[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,
-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]],db=bb[0]/2;function eb(a,b){for(var c=0,d=0;5>d;++d)c+=r(R(a,d,b))*bb[d];1<r(R(a,2,b))&&(c+=db);return c}function fb(a,b){for(var c=0,d=0;5>=d;++d)for(var g=G(R(a,d,b));!t(g);)var e=s(g),c=c+cb[d][b?e:56^e];return c}
function gb(a,b){var c=a.a[6+b],d=a.a[6+(b^1)],g=U(a),e=la(U(a)),h;h=0;var k,v=R(a,0,b),l=0===b;k=A(F(G(v),l?8:-8),e);e=A(A(F(A(G(v),L[l?1:6]),l?16:-16),e),F(G(e),l?8:-8));k=C(k,e);h=h+r(k);h+=r(A(Ua(b,R(a,0,b)),d));for(d=G(R(a,1,b));!t(d);)h+=r(B(G(Da[s(d)]),c));h+=r(B(G(Ea[ha(R(a,5,b))]),c));d=R(a,4,b);k=C(G(R(a,2,b)),d);h+=r(B(Oa(k,g),c));d=C(G(R(a,3,b)),d);h+=r(B(Pa(d,g),c));return h*bb[0]/100};function hb(){this.a=new Ma}function ib(){$("#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 kb(){$("#chessboard table tr td div.ui-draggable").draggable("destroy");$("#chessboard table tr td.ui-droppable").droppable("destroy")}
function lb(a){$("#moves").html("");var b=$("#dim");b.fadeIn(function(){function c(a,b,e,h){if(1>b)return d(a,e,h);for(var p=g(T(a,f,m)),k=0===a.c,l=m,n=0;n<p.length;++n)if(Z(a,p[n])){var l=f,z=c(a,b-1,e,h);ab(a);k?e=z>e?z:e:h=z<h?z:h;if(h<=e)break}if(!l){if(!V(a))return 0;a=bb[5];return k?-a:a}return 100<=a.h||Va(a)||Wa(a)?0:k?e:h}function d(a,b,c){if(100<=a.h||Va(a)||Wa(a))return 0;var e=eb(a,0)-eb(a,1)+(fb(a,0)-fb(a,1));++k;var h=0===a.c;if(h){if(e>=c)return c;b=e>b?e:b}else{if(e<=b)return b;c=
e<c?e:c}for(var e=g(T(a,f,!V(a))),p=0;p<e.length;++p)if(Z(a,e[p])){var n=d(a,b,c);ab(a);if(h){if(n>=c)return c;b=n>b?n:b}else{if(n<=b)return b;c=n<c?n:c}}return h?b:c}function g(a){function b(a){var c=P(a)&4?(1+(a.a>>>19&7))/(1+Q(a)):0,c=6*c+Q(a),c=16*c+P(a),c=64*c+(a.a&63);return c=64*c+O(a)}a.sort(function(a,c){return b(c)-b(a)});return a}var e,h=a.a,k=0;e=j;for(var v=-Infinity,l=Infinity,H=g(T(h,f)),n=0;n<H.length;++n)if(Z(h,H[n])){var x=c(h,3,v,l);ab(h);0===h.c?x>v&&(v=x,e=H[n]):x<l&&(l=x,e=H[n])}window.console.log("Evaluations: "+
k+", result move: "+La(e)+", alpha: "+v+", beta: "+l);if(!e)throw Error("Move not found");Z(a.a,e);h=$("#"+q(O(e)));e=$("#"+q(e.a&63));var w=e.offset().left-h.offset().left,p=e.offset().top-h.offset().top,z=h.children("div");z.css({position:"relative",top:"0px",left:"0px"});b.fadeOut(function(){z.animate({top:p+"px",left:w+"px"},function(){mb(a)})})})}
function mb(a){window.console.log("Moves: "+a.a.g.length+", white material: "+eb(a.a,0)+", black material: "+eb(a.a,1)+", white mobility: "+gb(a.a,0)+", black mobility: "+gb(a.a,1)+", white location: "+fb(a.a,0)+", black location: "+fb(a.a,1));ib();kb();$("#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 g=$("#"+q(d)),e=0;5>=e;++e)if(!u(a.a.a[e],d)){var h=0===a.a.c?!u(b,d):
!u(c,d),k=$("<div>");k.attr("title",g.attr("title")+"\nPiece: "+aa[e]+"\nColor: "+(!u(b,d)?"white":"black"));k.text("\u2659\u265f\u2658\u265e\u2657\u265d\u2656\u265c\u2655\u265b\u2654\u265a".charAt(2*e+(!u(b,d)?0:1)));var v=k.add(g);v.addClass(aa[e]);v.toggleClass("white",!u(b,d));v.toggleClass("black",!u(c,d));v.toggleClass("turn",h);g.append(k);break}b=!a.a.g.length?j:a.a.g[a.a.g.length-1];b!==j&&($("#"+q(O(b))).addClass("last-move"),$("#"+q(b.a&63)).addClass("last-move"));b=!T(a.a).length?V(a.a)?
1:2:100<=a.a.h?3:Va(a.a)?4:Wa(a.a)?5:0;if(0===b&&1===a.a.c)lb(a);else{var l=T(a.a);$("#moves").html('<a href="#" id="undo" class="'+(a.a.g.length?"can":"cannot")+'">undo</a><br/><a href="#" id="auto" class="'+(0<l.length?"can":"cannot")+'">auto</a><br/>'+l.map(function(a,b){return'<a href="#" id="'+b+'">'+La(a)+"</a><br/>"}).join(""));$("#chessboard table tr td, #chessboard table tr td div").removeClass("can-move");l.forEach(function(a){a=$("#"+q(O(a)));a.add(a.children()).addClass("can-move")});
var H=m;$("#chessboard table tr td div.can-move").mouseenter(function(){if(!H){var b=$(this),c=b.parent(),d=ca(""+c.attr("id")),c=c.add(b);c.toggleClass("from",l.some(function(a){return O(a)===d}));c.hasClass("from")&&(l.forEach(function(a){if(O(a)===d){var b=$("#"+q(a.a&63)),b=b.add(b.children());b.addClass("to");b.addClass(0===P(a)?"positional":"");b.addClass(P(a)&4?"capture":"");b.addClass(1===P(a)?"double-push":"");b.addClass(5===P(a)?"en-passant":"");b.addClass(P(a)&8?"promotion":"");b.addClass(Ja(a)?
"castle":"");b.addClass(2===P(a)?"king-castle":"");b.addClass(3===P(a)?"queen-castle":"")}}),kb(),$("#chessboard table tr td.to").droppable({drop:function(){var b=ca(""+$(this).attr("id")),c=l.filter(function(a){return O(a)===d&&(a.a&63)===b});0<c.length?(Z(a.a,c[0]),mb(a)):(ib(),kb())}}),b.draggable({start:function(){H=f},stop:function(){H=m},containment:"#chessboard table",zIndex:10,revert:"invalid"}))}}).mouseleave(function(){H||ib()});$("#moves a").click(function(){var b=$(this).attr("id");"undo"===
b?(ab(a.a),ab(a.a),mb(a)):"auto"===b?lb(a):(Z(a.a,l[parseInt(b,10)]),mb(a))});$("#dim").css({display:"none"});1===b?$("#moves").append("&#35;<br/>"+(a.a.c?"1-0":"0-1")):0!==b&&$("#moves").append("&frac12;-&frac12;")}};window.makeChessGame=function(){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,g=$("<tr>");a.append(g);var e='<th class="rank">'+(8-c)+"</th>";g.append(e);for(var h=0;8>h;++h){var k=$("<td>"),v=(d+h)%2?"light":"dark";k.attr("id",ba(d,h));k.attr("title","Algebraic: "+ba(d,h)+"\nRank: "+d+"\nFile: "+h+"\nIndex: "+(h+8*d)+"\nColor: "+v);k.addClass(v);g.append(k)}g.append(e)}a.append(b);
$("#chessboard").append(a);mb(new hb)};})();
-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]],sb=qb[h]/2;function tb(a,b){for(var c=0,d=h;d<k;++d)c+=r(R(a,d,b))*qb[d];1<r(R(a,2,b))&&(c+=sb);return c}function ub(a,b){for(var c=0,d=h;d<=k;++d)for(var e=F(R(a,d,b));!t(e);)var f=s(e),c=c+rb[d][b?f:56^f];return c}
function vb(a,b){var c=a.a[S+b],d=a.a[S+(b^1)],e=V(a),f=na(V(a)),g;g=0;var m,l=R(a,h,b),z=b===p;m=y(E(F(l),z?8:-8),f);f=y(y(E(y(F(l),K[z?1:6]),z?16:-16),f),E(F(f),z?8:-8));m=B(m,f);g=g+r(m);g+=r(y(fb(b,R(a,h,b)),d));for(d=F(R(a,1,b));!t(d);)g+=r(A(F(Fa[s(d)]),c));g+=r(A(F(Ga[ia(R(a,k,b))]),c));d=R(a,4,b);m=B(F(R(a,2,b)),d);g+=r(A(gb(m,e),c));d=B(F(R(a,3,b)),d);g+=r(A(hb(d,e),c));return g*qb[h]/100}
function wb(a){function b(a){function b(a){var c=P(a)&4?(1+(a.a>>>19&7))/(1+Q(a)):0,c=6*c+Q(a),c=16*c+P(a),c=64*c+(a.a&63);return c=64*c+O(a)}a.sort(function(a,c){return b(c)-b(a)});return a}function c(a,d,g){if(100<=a.h||jb(a)||kb(a))return 0;var f=tb(a,p)-tb(a,1)+(ub(a,p)-ub(a,1));++e;var m=a.c===p;if(m){if(f>=g)return g;d=f>d?f:d}else{if(f<=d)return d;g=f<g?f:g}for(var f=b(U(a,!0,!W(a))),l=0;l<f.length;++l)if(Z(a,f[l])){var n=c(a,d,g);pb(a);if(m){if(n>=g)return g;d=n>d?n:d}else{if(n<=d)return d;
g=n<g?n:g}}return m?d:g}function d(a,g,e,f){if(1>g)return c(a,e,f);for(var m=b(U(a,!0,!1)),l=a.c===p,n=!1,z=0;z<m.length;++z)if(Z(a,m[z])){var n=!0,ma=d(a,g-1,e,f);pb(a);l?e=ma>e?ma:e:f=ma<f?ma:f;if(f<=e)break}if(!n){if(!W(a))return 0;a=qb[k];return l?-a:a}return 100<=a.h||jb(a)||kb(a)?0:l?e:f}for(var e=0,f=null,g=-Infinity,m=Infinity,l=b(U(a,!0)),z=0;z<l.length;++z)if(Z(a,l[z])){var n=d(a,3,g,m);pb(a);a.c===p?n>g&&(g=n,f=l[z]):n<m&&(m=n,f=l[z])}window.console.log("Evaluations: "+e+", result move: "+
Ya(f)+", alpha: "+g+", beta: "+m);return f};function xb(){this.a=new ab}
function zb(){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,e=$("<tr>");a.append(e);var f='<th class="rank">'+(8-c)+"</th>";e.append(f);for(var g=0;8>g;++g){var m=$("<td>"),l=(d+g)%2?"light":"dark";m.attr("id",ca(d,g));m.attr("title","Algebraic: "+ca(d,g)+"\nRank: "+d+"\nFile: "+g+"\nIndex: "+(g+8*d)+"\nColor: "+l);m.addClass(l);e.append(m)}e.append(f)}a.append(b);$("#chessboard").append(a)}
function Ab(){$("#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 Bb(){$("#chessboard table tr td div.ui-draggable").draggable("destroy");$("#chessboard table tr td.ui-droppable").droppable("destroy")}
function Cb(a){var b=U(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+'">'+Ya(a)+"</a><br/>"}).join(""));$("#chessboard table tr td, #chessboard table tr td div").removeClass("can-move");b.forEach(function(a){a=$("#"+q(O(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),e=d.parent(),f=da(""+e.attr("id")),e=e.add(d);e.toggleClass("from",b.some(function(a){return O(a)===f}));e.hasClass("from")&&(b.forEach(function(a){if(O(a)===f){var b=$("#"+q(a.a&63)),b=b.add(b.children());b.addClass("to");b.addClass(P(a)===La?"positional":"");b.addClass(P(a)&4?"capture":"");b.addClass(1===P(a)?"double-push":"");b.addClass(5===P(a)?"en-passant":"");b.addClass(P(a)&8?"promotion":"");b.addClass(Va(a)?"castle":"");b.addClass(2===P(a)?"king-castle":"");b.addClass(3===P(a)?"queen-castle":
"")}}),Bb(),$("#chessboard table tr td.to").droppable({drop:function(){var c=da(""+$(this).attr("id")),d=b.filter(function(a){return O(a)===f&&(a.a&63)===c});0<d.length?(Z(a.a,d[0]),Db(a)):(Ab(),Bb())}}),d.draggable({start:function(){c=!0},stop:function(){c=!1},containment:"#chessboard table",zIndex:10,revert:"invalid"}))}}).mouseleave(function(){c||Ab()});$("#moves a").click(function(){var c=$(this).attr("id");"undo"===c?(pb(a.a),pb(a.a),Db(a)):"auto"===c?Eb(a):(Z(a.a,b[parseInt(c,10)]),Db(a))})}
function Eb(a){$("#moves").html("");var b=$("#dim");b.fadeIn(function(){var c=wb(a.a);if(!c)throw Error("Move not found");Z(a.a,c);var d=$("#"+q(O(c))),c=$("#"+q(c.a&63)),e=c.offset().left-d.offset().left,f=c.offset().top-d.offset().top,g=d.children("div");g.css({position:"relative",top:"0px",left:"0px"});b.fadeOut(function(){g.animate({top:f+"px",left:e+"px"},function(){Db(a)})})})}
function Db(a){window.console.log("Moves: "+a.a.g.length+", white material: "+tb(a.a,p)+", black material: "+tb(a.a,1)+", white mobility: "+vb(a.a,p)+", black mobility: "+vb(a.a,1)+", white location: "+ub(a.a,p)+", black location: "+ub(a.a,1));Ab();Bb();$("#chessboard table tr td div").remove();$("#chessboard table tr td").removeClass("white black turn last-move "+ba.join(" "));for(var b=a.a.a[S+p],c=a.a.a[S+1],d=0;64>d;++d)for(var e=$("#"+q(d)),f=h;f<=k;++f)if(!v(a.a.a[f],d)){var g=a.a.c===p?!v(b,
d):!v(c,d),m=$("<div>");m.attr("title",e.attr("title")+"\nPiece: "+ba[f]+"\nColor: "+(v(b,d)?"black":"white"));m.text("\u2659\u265f\u2658\u265e\u2657\u265d\u2656\u265c\u2655\u265b\u2654\u265a".charAt(2*f+(v(b,d)?1:p)));var l=m.add(e);l.addClass(ba[f]);l.toggleClass("white",!v(b,d));l.toggleClass("black",!v(c,d));l.toggleClass("turn",g);e.append(m);break}b=a.a.g.length?a.a.g[a.a.g.length-1]:null;null!==b&&($("#"+q(O(b))).addClass("last-move"),$("#"+q(b.a&63)).addClass("last-move"));b=U(a.a).length?
100<=a.a.h?3:jb(a.a)?4:kb(a.a)?5:0:W(a.a)?1:2;0===b&&1===a.a.c?Eb(a):(Cb(a),$("#dim").css({display:"none"}),1===b?$("#moves").append("&#35;<br/>"+(a.a.c?"1-0":"0-1")):0!==b&&$("#moves").append("&frac12;-&frac12;"))};window.makeChessGame=function(){zb();Db(new xb)};})();

2
src/move.js

@ -66,7 +66,7 @@ Chess.Move.prototype.isCapture = function() {
/**
* @return {!Chess.Piece}
*/
Chess.Move.prototype.getCapturedPiece = function(piece) {
Chess.Move.prototype.getCapturedPiece = function() {
return /** @type {!Chess.Piece} */ ((this.value >>> 19) & 0x7);
};

Loading…
Cancel
Save