import { ChessRules, Move, PiPo } from "@/base_rules";
export class CannibalRules extends ChessRules {
+
static get KING_CODE() {
return {
'p': 's',
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;
}
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++;
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);
}
return notation;
}
+
};