X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FWildebeest.js;h=8664e5ed571b99cc46c58434cccd5b78d160c4d9;hb=2c5d7b20742b802d9c47916915c1114bcfc9a9c3;hp=8192fa04d6b4dce8dca6342baad1db1b0a8570a0;hpb=32f6285ee325a14286562a53baefc647201df2af;p=vchess.git diff --git a/client/src/variants/Wildebeest.js b/client/src/variants/Wildebeest.js index 8192fa04..8664e5ed 100644 --- a/client/src/variants/Wildebeest.js +++ b/client/src/variants/Wildebeest.js @@ -20,7 +20,9 @@ export class WildebeestRules extends ChessRules { static get steps() { return Object.assign( - ChessRules.steps, //add camel moves: + {}, + ChessRules.steps, + // Add camel moves: { c: [ [-3, -1], @@ -225,10 +227,7 @@ export class WildebeestRules extends ChessRules { } getCurrentScore() { - if (this.atLeastOneMove()) - // game not over - return "*"; - + if (this.atLeastOneMove()) return "*"; // No valid move: game is lost (stalemate is a win) return this.turn == "w" ? "0-1" : "1-0"; } @@ -246,10 +245,14 @@ export class WildebeestRules extends ChessRules { static GenRandInitFen(randomness) { if (!randomness) randomness = 2; - if (randomness == 0) - return "rnccwkqbbnr/ppppppppppp/11/11/11/11/11/11/PPPPPPPPPPP/RNBBQKWCCNR w 0 akak -"; + if (randomness == 0) { + return ( + "rnccwkqbbnr/ppppppppppp/92/92/92/92/92/92/PPPPPPPPPPP/RNBBQKWCCNR " + + "w 0 akak -" + ); + } - let pieces = { w: new Array(10), b: new Array(10) }; + let pieces = { w: new Array(11), b: new Array(11) }; let flags = ""; for (let c of ["w", "b"]) { if (c == 'b' && randomness == 1) { @@ -314,7 +317,7 @@ export class WildebeestRules extends ChessRules { } return ( pieces["b"].join("") + - "/ppppppppppp/11/11/11/11/11/11/PPPPPPPPPPP/" + + "/ppppppppppp/92/92/92/92/92/92/PPPPPPPPPPP/" + pieces["w"].join("").toUpperCase() + " w 0 " + flags + " -" );