1 import { ChessRules
} from "@/base_rules";
3 export class PawnmassacreRules
extends ChessRules
{
5 static get HasFlags() {
13 static GenRandInitFen(randomness
) {
15 ChessRules
.GenRandInitFen(randomness
)
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
))