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