c08b585bca0ed87c611250238f93121124a03892
1 import { ChessRules
} from "@/base_rules";
3 export class PawnmassacreRules
extends ChessRules
{
5 static get HasFlags() {
13 static GenRandInitFen(options
) {
15 ChessRules
.GenRandInitFen(options
)
16 // Remove castle flags
17 .slice(0, -6).concat("-");
18 const splitIdx
= bFen
.indexOf(' ');
20 bFen
.substr(0, splitIdx
)
21 .replace("PPPPPPPP", "pppppppp")
22 // Next replacement is OK because only acts on first occurrence
23 .replace("pppppppp", "PPPPPPPP")
24 .split("").reverse().join("")
25 .concat(bFen
.substr(splitIdx
))