- 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:
- const fenParts = baseFen.split(" ");
- let others = JSON.parse(fenParts[3]);
- others["cmove"] = "-";
- return fenParts.slice(0, 3).join(" ") + " " + JSON.stringify(others);
+ 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: {}
+ };