return ChessRules.PIECES.concat([V.IMMOBILIZER]);
}
+ static get Lines() {
+ return [
+ [[1, 1], [1, 9]],
+ [[1, 9], [9, 9]],
+ [[9, 9], [9, 1]],
+ [[9, 1], [1, 1]]
+ ];
+ }
+
getPpath(b) {
if (b[1] == "m")
//'m' for Immobilizer (I is too similar to 1)
this.kingPos["w"] = [i, k];
break;
default: {
- const num = parseInt(position[i].charAt(j));
+ const num = parseInt(position[i].charAt(j), 10);
if (!isNaN(num)) k += num - 1;
}
}
getPotentialMovesFrom([x, y]) {
// Pre-check: is thing on this square immobilized?
const imSq = this.isImmobilized([x, y]);
- if (!!imSq) {
- // Only option is suicide:
+ const piece = this.getPiece(x, y);
+ if (!!imSq && piece != V.KING) {
+ // Only option is suicide, if I'm not a king:
return [
new Move({
start: { x: x, y: y },
];
}
let moves = [];
- switch (this.getPiece(x, y)) {
+ switch (piece) {
case V.IMMOBILIZER:
moves = this.getPotentialImmobilizerMoves([x, y]);
break;
static GenRandInitFen(randomness) {
if (randomness == 0) {
return (
- "91/1rnbkqbnm1/1pppppppp1/91/91/91/91/1PPPPPPPP1/1MNBQKBNR1/91 w 0 -"
+ "91/1rqnbknqm1/1pppppppp1/91/91/91/91/1PPPPPPPP1/1MQNBKNQR1/91 w 0 -"
);
}