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