X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FPawnmassacre.js;fp=client%2Fsrc%2Fvariants%2FPawnmassacre.js;h=563fd00b90df9447e11f5c4fc6b0535c6c3cf543;hp=0000000000000000000000000000000000000000;hb=737a5dafb39740ebe304b8d0a82df85070def571;hpb=1b56b73614509d1dca8c4353f18fb78349940cf8 diff --git a/client/src/variants/Pawnmassacre.js b/client/src/variants/Pawnmassacre.js new file mode 100644 index 00000000..563fd00b --- /dev/null +++ b/client/src/variants/Pawnmassacre.js @@ -0,0 +1,18 @@ +import { ChessRules } from "@/base_rules"; + +export class PawnmassacreRules extends ChessRules { + static get HasFlags() { + return false; + } + + static GenRandInitFen(randomness) { + return ( + ChessRules.GenRandIntFen(randomness) + // Remove castle flags + .slice(0, -6).concat("-") + .replace("PPPPPPPP", "pppppppp") + // Next replacement is OK because only acts on first occurrence + .replace("pppppppp", "PPPPPPPP") + ); + } +};