X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSynchrone2.js;h=17b0be325643ac0a8fcc1894ba1f5f75d32f8da5;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=af77a8c08c0f64f2b1740f9f9e47ba61efedbcaf;hpb=cb1165b46266a73b2a1f211a9c98470b1ceaacd3;p=vchess.git diff --git a/client/src/variants/Synchrone2.js b/client/src/variants/Synchrone2.js index af77a8c0..17b0be32 100644 --- a/client/src/variants/Synchrone2.js +++ b/client/src/variants/Synchrone2.js @@ -47,8 +47,8 @@ export class Synchrone2Rules extends Synchrone1Rules { ); } - static GenRandInitFen(randomness) { - const res = ChessRules.GenRandInitFen(randomness); + static GenRandInitFen(options) { + const res = ChessRules.GenRandInitFen(options); // Add initFen field: return res.slice(0, -1) + res.split(' ')[0] + " -"; } @@ -102,7 +102,7 @@ export class Synchrone2Rules extends Synchrone1Rules { ); }); const passTarget = - (x != this.kingPos[c][0] || y != this.kingPos[c][0]) ? c : oppCol; + (x != this.kingPos[c][0] || y != this.kingPos[c][1]) ? c : oppCol; movesNow.push( new Move({ start: { x: x, y: y }, @@ -223,12 +223,15 @@ export class Synchrone2Rules extends Synchrone1Rules { } getCurrentScore() { - if (this.movesCount % 4 != 0) - // Turn (2 x [white + black]) not over yet + if (this.movesCount % 2 != 0) + // Turn [white + black] not over yet return "*"; // Was a king captured? if (this.kingPos['w'][0] < 0) return "0-1"; if (this.kingPos['b'][0] < 0) return "1-0"; + if (this.movesCount % 4 == 2) + // Turn (2 x [white + black]) not over yet + return "*"; const whiteCanMove = this.atLeastOneMove('w'); const blackCanMove = this.atLeastOneMove('b'); if (whiteCanMove && blackCanMove) return "*";