X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=variants%2FSuction%2Fclass.js;h=a66855d407bc1def69668342bb7012addb049911;hp=dbaefa0a72b81888b8fd1ed9c9a9e0228069eb4e;hb=6b9320bb6e42ece7694df32f85aab4d2989f6a13;hpb=ca8a399316d2496c069ea9c6ccf2dc241aeb70ef diff --git a/variants/Suction/class.js b/variants/Suction/class.js index dbaefa0..a66855d 100644 --- a/variants/Suction/class.js +++ b/variants/Suction/class.js @@ -44,9 +44,12 @@ export default class SuctionRules extends ChessRules { genRandInitFen(seed) { const options = Object.assign({mode: "suicide"}, this.options); const gr = new GiveawayRules({options: options, genFenOnly: true}); + const baseFen = gr.genRandInitFen(seed); // Add empty cmove: - return ( - gr.genRandInitFen(seed).slice(0, -17) + '{"enpassant":"-","cmove":"-"}'); + const fenParts = baseFen.split(" "); + let others = JSON.parse(fenParts[3]); + others["cmove"] = "-"; + return fenParts.slice(0, 3).join(" ") + " " + JSON.stringify(others); } getFen() {