Commit | Line | Data |
---|---|---|
737a5daf BA |
1 | import { ChessRules } from "@/base_rules"; |
2 | ||
3 | export class PawnmassacreRules extends ChessRules { | |
4 | static get HasFlags() { | |
5 | return false; | |
6 | } | |
7 | ||
8 | static GenRandInitFen(randomness) { | |
9 | return ( | |
10 | ChessRules.GenRandIntFen(randomness) | |
11 | // Remove castle flags | |
12 | .slice(0, -6).concat("-") | |
13 | .replace("PPPPPPPP", "pppppppp") | |
14 | // Next replacement is OK because only acts on first occurrence | |
15 | .replace("pppppppp", "PPPPPPPP") | |
16 | ); | |
17 | } | |
18 | }; |