- if (this.options["randomness"] == 0)
- return "rnbkqbnm/pppppppp/8/8/8/8/PPPPPPPP/MNBQKBNR";
- const options = Object.assign({mode: "suicide"}, this.options);
- const gr = new GiveawayRules({options: options, genFenOnly: true});
- let res = gr.genRandInitBaseFen();
- let immPos = {};
- for (let c of ['w', 'b']) {
- const rookChar = (c == 'w' ? 'R' : 'r');
- switch (Random.randInt(2)) {
- case 0:
- immPos[c] = res.fen.indexOf(rookChar);
- break;
- case 1:
- immPos[c] = res.fen.lastIndexOf(rookChar);
- break;
+ const s = FenUtil.setupPieces(
+ ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'i'],
+ {
+ randomness: this.options["randomness"],
+ diffCol: ['b']