X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FSuction%2Fclass.js;h=ff307d4a3d4cde9e5d76255b5e36f7d27c30d63e;hb=a55fde41f82207bf401c54b158dd6d0182799fd3;hp=889a37ff1d0e9541f7d1e2563b4b0aca6af65788;hpb=f31de5e46015a93dca20765da61670035ce8f491;p=xogo.git diff --git a/variants/Suction/class.js b/variants/Suction/class.js index 889a37f..ff307d4 100644 --- a/variants/Suction/class.js +++ b/variants/Suction/class.js @@ -1,5 +1,5 @@ import ChessRules from "/base_rules.js"; -import GiveawayRules from "/variants/Giveaway/class.js"; +import {FenUtil} from "/utils/setupPieces.js"; import PiPo from "/utils/PiPo.js"; import Move from "/utils/Move.js"; @@ -42,9 +42,18 @@ export default class SuctionRules extends ChessRules { } genRandInitBaseFen() { - const options = Object.assign({mode: "suicide"}, this.options); - const gr = new GiveawayRules({options: options, genFenOnly: true}); - return gr.genRandInitBaseFen(); + const s = FenUtil.setupPieces( + ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'r'], + { + randomness: this.options["randomness"], + diffCol: ['b'] + } + ); + return { + fen: s.b.join("") + "/pppppppp/8/8/8/8/PPPPPPPP/" + + s.w.join("").toUpperCase(), + o: {} + }; } getPartFen(o) {