X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FGrand.js;h=5523244ba1674763b29c0bb129e707cd0e981f1b;hp=d4f620f7596d2c8bfe08e374501e21f047b443c6;hb=32f6285ee325a14286562a53baefc647201df2af;hpb=11482348f50058d235adb89bfc174a1da7c6abc4 diff --git a/client/src/variants/Grand.js b/client/src/variants/Grand.js index d4f620f7..5523244b 100644 --- a/client/src/variants/Grand.js +++ b/client/src/variants/Grand.js @@ -4,7 +4,7 @@ import { randInt } from "@/utils/alea"; // NOTE: initial setup differs from the original; see // https://www.chessvariants.com/large.dir/freeling.html -export const VariantRules = class GrandRules extends ChessRules { +export class GrandRules extends ChessRules { static IsGoodFen(fen) { if (!ChessRules.IsGoodFen(fen)) return false; const fenParsed = V.ParseFen(fen); @@ -223,7 +223,7 @@ export const VariantRules = class GrandRules extends ChessRules { for (let epsq of epSquare) { // TODO: some redundant checks if (epsq.x == x + shiftX && Math.abs(epsq.y - y) == 1) { - var enpassantMove = this.getBasicMove([x, y], [epsq.x, epsq.y]); + let enpassantMove = this.getBasicMove([x, y], [epsq.x, epsq.y]); // WARNING: the captured pawn may be diagonally behind us, // if it's a 3-squares jump and we take on 1st passing square const px = this.board[x][epsq.y] != V.EMPTY ? x : x - shiftX;