- let counts = new Array(10);
- for (
- let i = 0;
- i < V.PIECES.length - 1;
- i++ //-1: no king reserve
+ return (
+ Object.keys(this.reserve).map(
+ c => Object.values(this.reserve[c]).join("")).join("")
+ );
+ }
+
+ getEpSquare(moveOrSquare) {
+ if (!moveOrSquare) return undefined;
+ if (typeof moveOrSquare === "string") {
+ const square = moveOrSquare;
+ if (square == "-") return undefined;
+ return V.SquareToCoords(square);
+ }
+ const move = moveOrSquare;
+ const s = move.start,
+ e = move.end;
+ if (
+ s.y == e.y &&
+ Math.abs(s.x - e.x) == 2 &&
+ move.vanish.length > 0 && ['p', 's'].includes(move.vanish[0].p)