import { randInt } from "@/utils/alea";
export class DiceRules extends ChessRules {
+
static get CanAnalyze() {
return false;
}
return super.getFen() + " " + this.getToplayFen();
}
- getFen() {
+ getFenForRepeat() {
return super.getFenForRepeat() + "_" + this.getToplayFen();
}
return (L > 0 ? this.p2play[L-1] : "-");
}
- static GenRandInitFen(randomness) {
- return ChessRules.GenRandInitFen(randomness) + " -";
+ static GenRandInitFen(options) {
+ return ChessRules.GenRandInitFen(options) + " -";
}
canMove(piece, color, [x, y]) {
V.PlayOnBoard(this.board, m);
const [piece, square] = this.getRandPiece(oppCol);
m.start.toplay = square;
- m.end.piece = piece;
+ m.end.p = piece;
V.UndoOnBoard(this.board, m);
});
return moves;
}
postPlay(move) {
- this.p2play.push(move.end.piece);
+ this.p2play.push(move.end.p);
if (move.vanish.length == 2 && move.vanish[1].p == V.KING)
this.kingPos[move.vanish[1].c] = [-1, -1];
// Castle flags for captured king won't be updated (not important...)
}
getNotation(move) {
- return super.getNotation(move) + "/" + move.end.piece.toUpperCase();
+ return super.getNotation(move) + "/" + move.end.p.toUpperCase();
}
+
};