X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FMonochrome.js;h=2d5a912f577319f9ddfeb8070570606fa44e4967;hp=919e7703fe95360020f42262353406a382006e0f;hb=306dab5f2087a35669a114587c0415b31145665b;hpb=eaab401ea14ebbde1e49ede7c639bc3b6556bf08 diff --git a/client/src/variants/Monochrome.js b/client/src/variants/Monochrome.js index 919e7703..2d5a912f 100644 --- a/client/src/variants/Monochrome.js +++ b/client/src/variants/Monochrome.js @@ -37,6 +37,10 @@ export class MonochromeRules extends ChessRules { return true; } + getPpath(b) { + return (b[1] == V.KNIGHT ? "Enpassant/" : "") + b; + } + canIplay(side, [x, y]) { const xBounds = side == 'w' ? [4,7] : [0,3]; return this.turn == side && x >= xBounds[0] && x <= xBounds[1]; @@ -154,6 +158,8 @@ export class MonochromeRules extends ChessRules { static GenRandInitFen(randomness) { // Remove the en-passant + castle part of the FEN let fen = ChessRules.GenRandInitFen(randomness).slice(0, -6); + // Replace kings with queens + fen = fen.replace("k", "q").replace("K", "Q"); // Move pawns up: fen = fen.replace("pppppppp/8","8/pppppppp") .replace("8/PPPPPPPP","PPPPPPPP/8");