X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FMarseille.js;h=0439ab4d2c61e3de3a01e7385b7f167641730f9f;hp=2d4ecfa4207a31f778ccaf7107f0db949bacde7a;hb=0c3fe8a6c3e02af46e0bc646b40c1a0c420f9dcd;hpb=41c80bb63b85b2696d3925c10784c3d7bb5d2aa3 diff --git a/client/src/variants/Marseille.js b/client/src/variants/Marseille.js index 2d4ecfa4..0439ab4d 100644 --- a/client/src/variants/Marseille.js +++ b/client/src/variants/Marseille.js @@ -205,6 +205,7 @@ class MarseilleRules extends ChessRules }; } + // TODO: this is wrong: revise following base_rules.getComputerMove() // No alpha-beta here, just adapted min-max at depth 2(+1) getComputerMove() { @@ -221,7 +222,7 @@ class MarseilleRules extends ChessRules let moves = this.getAllValidMoves(); if (moves.length == 0) { - const score = this.checkGameEnd(); + const score = this.getCurrentScore(); if (score == "1/2") return 0; return maxeval * (score == "1-0" ? 1 : -1); @@ -234,7 +235,7 @@ class MarseilleRules extends ChessRules // Otherwise it's color,1. In both cases the next test makes sense if (!this.atLeastOneMove()) { - const score = this.checkGameEnd(); + const score = this.getCurrentScore(); if (score == "1/2") res = (oppCol == "w" ? Math.max(res, 0) : Math.min(res, 0)); else