X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FChakart%2Fclass.js;fp=variants%2FChakart%2Fclass.js;h=aefbcd0467d4d0f6079482264bc898174d2684a5;hb=7c03823594cef3ce6e8da7ac1d7d3504c73695a9;hp=96a53f3640990b32479cce6d424a82a4b3d19e54;hpb=0adfbdb55452c79532875beb8eed61b1ed4c6cd2;p=xogo.git diff --git a/variants/Chakart/class.js b/variants/Chakart/class.js index 96a53f3..aefbcd0 100644 --- a/variants/Chakart/class.js +++ b/variants/Chakart/class.js @@ -1,7 +1,7 @@ import ChessRules from "/base_rules.js"; -import GiveawayRules from "/variants/Giveaway/class.js"; import {ArrayFun} from "/utils/array.js"; import {Random} from "/utils/alea.js"; +import {FenUtil} from "/utils/setupPieces.js"; import PiPo from "/utils/PiPo.js"; import Move from "/utils/Move.js"; @@ -131,11 +131,13 @@ export default class ChakartRules extends ChessRules { } genRandInitBaseFen() { - const options = Object.assign({mode: "suicide"}, this.options); - const gr = new GiveawayRules({options: options, genFenOnly: true}); - let res = gr.genRandInitBaseFen(); - res.o["flags"] = "1111"; //Peach + Mario flags - return res; + 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: {flags: "1111"} //Peach + Mario + }; } fen2board(f) {