);
}
- static GenRandInitFen(randomness) {
- return ChessRules.GenRandInitFen(randomness) + " -";
+ static GenRandInitFen(options) {
+ return ChessRules.GenRandInitFen(options) + " -";
}
setOtherVariables(fen) {
this.getPiece(x, y) == V.KING
// No castling with enemy king (...yes, should eat it but...)
? super.getSlideNJumpMoves(
- [x, y], V.steps[V.ROOK].concat(V.steps[V.BISHOP]), "oneStep")
+ [x, y], V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1)
: super.getPotentialMovesFrom([x, y]);
return moves;
}
+ getAllPotentialMoves() {
+ let potentialMoves = [];
+ for (let i = 0; i < V.size.x; i++) {
+ for (let j = 0; j < V.size.y; j++) {
+ if (this.board[i][j] != V.EMPTY) {
+ Array.prototype.push.apply(
+ potentialMoves,
+ this.getPotentialMovesFrom([i, j])
+ );
+ }
+ }
+ }
+ return potentialMoves;
+ }
+
getEnpassantCaptures([x, y], shiftX) {
const Lep = this.epSquares.length;
const epSquare = this.epSquares[Lep - 1]; //always at least one element