// 5) Check whiteMove
if (
(
- fenParsed.turn == "w" &&
+ fenParsed.turn == "b" &&
// NOTE: do not check really JSON stringified move...
(!fenParsed.whiteMove || fenParsed.whiteMove == "-")
)
||
- (fenParsed.turn == "b" && fenParsed.whiteMove != "-")
+ (fenParsed.turn == "w" && fenParsed.whiteMove != "-")
) {
return false;
}
let moveSet = {};
let moves = [];
oppCaptureMoves.forEach(m => {
- // If another opponent capture with same endpoint already processed, skip:
+ // If another opponent capture with same endpoint already processed, skip
const mHash = "m" + m.end.x + m.end.y;
if (!moveSet[mHash]) {
moveSet[mHash] = true;
};
V.PlayOnBoard(this.board, justDisappear);
// Can I take on [m.end.x, m.end.y] ? If yes, add to list:
- this.getCaptures(m.end.x, m.end.y, color).forEach(cm => moves.push(cm));
+ this.getCaptures(m.end.x, m.end.y, color)
+ .forEach(cm => moves.push(cm));
V.UndoOnBoard(this.board, justDisappear);
}
});