X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FTwokings.js;h=d80a57d8fadd0be5a5b06f3c6d67eef87d9283ef;hb=b51164440aa73d056c433c88457c9f7af1180953;hp=a5bd76afeb8e619a2f5e713001176ca2656beca9;hpb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;p=vchess.git diff --git a/client/src/variants/Twokings.js b/client/src/variants/Twokings.js index a5bd76af..d80a57d8 100644 --- a/client/src/variants/Twokings.js +++ b/client/src/variants/Twokings.js @@ -15,7 +15,7 @@ export class TwokingsRules extends CoregalRules { if (position.length == 0) return false; const rows = position.split("/"); if (rows.length != V.size.x) return false; - let kings = { "w": 0, "b": 0 }; + let kings = { 'K': 0, 'k': 0 }; for (let row of rows) { let sumElts = 0; for (let i = 0; i < row.length; i++) { @@ -55,8 +55,8 @@ export class TwokingsRules extends CoregalRules { return squares; } - static GenRandInitFen(randomness) { - if (randomness == 0) + static GenRandInitFen(options) { + if (options.randomness == 0) return "rnqkkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNQKKBNR w 0 adehadeh -"; const replaceBishop = (fen, first, ch1, ch2) => { @@ -84,11 +84,11 @@ export class TwokingsRules extends CoregalRules { }; const fen = - CoregalRules.GenRandInitFen(randomness) + CoregalRules.GenRandInitFen(options) .replace("q", "k").replace("Q", "K"); // Now replace a bishop by the queen, // so that bishops are of different colors: - if (randomness == 1) return sameIndexReplace(fen); + if (options.randomness == 1) return sameIndexReplace(fen); const wOdd = fen.indexOf('B') % 2; const bOdd = fen.indexOf('b') % 2; // Since there are 7 slashes, different oddities means symmetric