X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FLosers.js;h=ea2838096ff8b1d5196d58a2d6a53f312c231e37;hb=HEAD;hp=3ac46c2fdee410f1aea42a6940a8f5f6b6a87a06;hpb=8e346ebebfdaec1538f9728fa7a279027c990f78;p=vchess.git diff --git a/client/src/variants/Losers.js b/client/src/variants/Losers.js index 3ac46c2f..ea283809 100644 --- a/client/src/variants/Losers.js +++ b/client/src/variants/Losers.js @@ -3,6 +3,7 @@ import { ArrayFun } from "@/utils/array"; import { randInt } from "@/utils/alea"; export class LosersRules extends ChessRules { + // Trim all non-capturing moves static KeepCaptures(moves) { return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1); @@ -34,9 +35,6 @@ export class LosersRules extends ChessRules { getPossibleMovesFrom(sq) { let moves = this.filterValid(this.getPotentialMovesFrom(sq)); const captureMoves = V.KeepCaptures(moves); - -console.log(this.atLeastOneCapture()); - if (captureMoves.length > 0) return captureMoves; if (this.atLeastOneCapture()) return []; return moves; @@ -75,4 +73,5 @@ console.log(this.atLeastOneCapture()); // Less material is better (more subtle in fact but...) return -super.evalPosition(); } + };