return res;
}
- updateVariables(move) {
- super.updateVariables(move);
+ postPlay(move) {
+ super.postPlay(move);
const piece = move.vanish[0].p;
const c = move.vanish[0].c;
// Update antiking position
}
}
- unupdateVariables(move) {
- super.unupdateVariables(move);
+ postUndo(move) {
+ super.postUndo(move);
const c = move.vanish[0].c;
if (move.vanish[0].p == V.ANTIKING)
this.antikingPos[c] = [move.start.x, move.start.y];
}
static get VALUES() {
- return Object.assign(ChessRules.VALUES, { a: 1000 });
+ return Object.assign(
+ { a: 1000 },
+ ChessRules.VALUES
+ );
}
- static GenRandInitFen() {
+ static GenRandInitFen(randomness) {
+ if (randomness == 0)
+ return "rnbqkbnr/pppppppp/3A4/8/8/3a4/PPPPPPPP/RNBQKBNR w 0 ahah -";
+
let pieces = { w: new Array(8), b: new Array(8) };
+ let flags = "";
let antikingPos = { w: -1, b: -1 };
for (let c of ["w", "b"]) {
+ if (c == 'b' && randomness == 1) {
+ pieces['b'] = pieces['w'];
+ antikingPos['b'] = antikingPos['w'];
+ flags += flags;
+ break;
+ }
+
let positions = ArrayFun.range(8);
// Get random squares for bishops, but avoid corners; because,
pieces[c][bishop2Pos] = "b";
pieces[c][knight2Pos] = "n";
pieces[c][rook2Pos] = "r";
+ flags += V.CoordToColumn(rook1Pos) + V.CoordToColumn(rook2Pos);
}
const ranks23_black =
"pppppppp/" +
ranks23_white +
"/" +
pieces["w"].join("").toUpperCase() +
- " w 0 1111 -"
+ " w 0 " + flags + " -"
);
}
+
+ static get SEARCH_DEPTH() {
+ return 2;
+ }
};