X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FSuction%2Fclass.js;h=6a66a068d4542e789a969206f328680d48895b48;hb=7c03823594cef3ce6e8da7ac1d7d3504c73695a9;hp=889a37ff1d0e9541f7d1e2563b4b0aca6af65788;hpb=0adfbdb55452c79532875beb8eed61b1ed4c6cd2;p=xogo.git diff --git a/variants/Suction/class.js b/variants/Suction/class.js index 889a37f..6a66a06 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,13 @@ 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'], {diffCol: ['b']}); + return { + fen: s.b.join("") + "/pppppppp/8/8/8/8/PPPPPPPP/" + + s.w.join("").toUpperCase(), + o: {} + }; } getPartFen(o) {