getPpath(b) {
// TODO: !!this.checkFlags condition for printDiagram, but clearly not good.
// This is just a temporary fix.
- if (b[1] == 'k' && this.checkFlags && this.checkFlags[b[0]] > 0)
+ if (b[1] == 'k' && !!this.checkFlags && this.checkFlags[b[0]] > 0)
return "Threechecks/" + b[0] + 'k_' + this.checkFlags[b[0]];
return b;
}
- updateVariables(move) {
- super.updateVariables(move);
+ postPlay(move) {
+ super.postPlay(move);
// Does this move give check?
const oppCol = this.turn;
if (this.underCheck(oppCol))
return super.getCurrentScore();
}
- static GenRandInitFen() {
- const randFen = ChessRules.GenRandInitFen();
+ static GenRandInitFen(randomness) {
// Add check flags (at 0)
- return randFen.replace(" w 0 1111", " w 0 111100");
+ return ChessRules.GenRandInitFen(randomness).slice(0, -2) + "00";
}
getFlagsFen() {
let fen = super.getFlagsFen();
// Add check flags
- for (let c of ["w", "b"])
- fen += this.checkFlags[c];
+ for (let c of ["w", "b"]) fen += this.checkFlags[c];
return fen;
}