X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FMinixiangqi.js;h=d8f6ebba0d2c9de2a8c0dba716ad2b0e38b41976;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=34e7d1985353274ff2d64d9cf32cd9337e44252c;hpb=9a1e3abe33fff07218b17c7c799eb622a730b7c7;p=vchess.git diff --git a/client/src/variants/Minixiangqi.js b/client/src/variants/Minixiangqi.js index 34e7d198..d8f6ebba 100644 --- a/client/src/variants/Minixiangqi.js +++ b/client/src/variants/Minixiangqi.js @@ -39,7 +39,7 @@ export class MinixiangqiRules extends XiangqiRules { if (!lastRank) steps.push([shiftX, 0]); if (y > 0) steps.push([0, -1]); if (y < 9) steps.push([0, 1]); - return super.getSlideNJumpMoves([x, y], steps, "oneStep"); + return super.getSlideNJumpMoves([x, y], steps, 1); } insidePalace(x, y, c) { @@ -67,13 +67,19 @@ export class MinixiangqiRules extends XiangqiRules { let evaluation = 0; for (let i = 0; i < V.size.x; i++) { for (let j = 0; j < V.size.y; j++) { - if (this.board[i][j] != V.EMPTY) - evaluation += (c == 'w' ? 1 : -1) * V.VALUES[this.getPiece(i, j)]; + if (this.board[i][j] != V.EMPTY) { + const sign = this.getColor(i, j) == "w" ? 1 : -1; + evaluation += sign * V.VALUES[this.getPiece(i, j)]; + } } } return evaluation; } + static get SEARCH_DEPTH() { + return 3; + } + // Also no randomization here static GenRandInitFen() { return "rcnkncr/p1ppp1p/7/7/7/P1PPP1P/RCNKNCR w 0";