this.pawnFlags = flags[1];
}
- static GenRandInitFen(randomness) {
+ static GenRandInitFen(options) {
// Add 16 pawns flags:
- return ChessRules.GenRandInitFen(randomness)
+ return ChessRules.GenRandInitFen(options)
.slice(0, -2) + "1111111111111111 -";
}
}
let baseMoves = [];
const c = this.turn;
- switch (piece || this.getPiece(x, y)) {
+ switch (piece) {
case V.PAWN: {
const firstRank = (c == 'w' ? 7 : 0);
baseMoves = this.getPotentialPawnMoves([x, y]).filter(m => {
break;
case V.KING:
baseMoves = this.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);
if (!noCastle && this.castleFlags[this.turn].some(v => v < V.size.y))
baseMoves = baseMoves.concat(this.getCastleMoves([x, y]));
break;