X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FWildebeest.js;h=565f6275af953cac7924e68f4389262edef019b0;hp=fa89cb2170285d316031f056df2170c0f30cc6b4;hb=7ba4a5bc5b64e19a1e7f26aa232d5c50770d07ad;hpb=de520e01c680ca3d74364f73cd29c026b86a883d diff --git a/client/src/variants/Wildebeest.js b/client/src/variants/Wildebeest.js index fa89cb21..565f6275 100644 --- a/client/src/variants/Wildebeest.js +++ b/client/src/variants/Wildebeest.js @@ -244,9 +244,18 @@ export const VariantRules = class WildebeestRules extends ChessRules { return 2; } - static GenRandInitFen() { + static GenRandInitFen(randomness) { + if (!randomness) randomness = 2; + if (randomness == 0) + return "rnccwkqbbnr/ppppppppppp/11/11/11/11/11/11/PPPPPPPPPPP/RNBBQKWCCNR w 0 1111 -"; + let pieces = { w: new Array(10), b: new Array(10) }; for (let c of ["w", "b"]) { + if (c == 'b' && randomness == 1) { + pieces['b'] = pieces['w']; + break; + } + let positions = ArrayFun.range(11); // Get random squares for bishops + camels (different colors) @@ -264,7 +273,7 @@ export const VariantRules = class WildebeestRules extends ChessRules { for (let idx of randIndexes.concat(randIndexes_tmp).sort((a, b) => { return b - a; })) { - //largest indices first + // Largest indices first positions.splice(idx, 1); }