X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCannibal.js;h=bd5524f7a833bf68369258cf6593470ff33ff7a9;hb=e50a802531b99829c533f22ecd21e359e7e1e049;hp=f7a9514969b40ada8859bec98f3de2fa9035802f;hpb=472c0c4f5aa29d96e080873ebfce2a04f664d852;p=vchess.git diff --git a/client/src/variants/Cannibal.js b/client/src/variants/Cannibal.js index f7a95149..bd5524f7 100644 --- a/client/src/variants/Cannibal.js +++ b/client/src/variants/Cannibal.js @@ -49,7 +49,7 @@ export class CannibalRules extends ChessRules { else if (kingWhiteCodes.includes(row[i])) kings['w']++; if (allPiecesCodes.includes(row[i].toLowerCase())) sumElts++; else { - const num = parseInt(row[i]); + const num = parseInt(row[i], 10); if (isNaN(num)) return false; sumElts += num; } @@ -74,7 +74,7 @@ export class CannibalRules extends ChessRules { const color = (piece.charCodeAt(0) <= 90 ? 'w' : 'b'); this.kingPos[color] = [i, k]; } else { - const num = parseInt(rows[i].charAt(j)); + const num = parseInt(rows[i].charAt(j), 10); if (!isNaN(num)) k += num - 1; } k++; @@ -88,7 +88,7 @@ export class CannibalRules extends ChessRules { return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1); } - // Stop at the first capture found (if any) + // Stop at the first capture found (if any) atLeastOneCapture() { const color = this.turn; const oppCol = V.GetOppCol(color);