- const moves = this.getAllValidMoves();
- return moves.filter(m => {
- return m.start.x == x && m.start.y == y;
- });
+ return (
+ this.filterValid(super.getPotentialMovesFrom([x, y]))
+ // Augment with potential recaptures:
+ .concat(this.getRecaptures())
+ );
const oppCol = V.GetOppCol(color);
for (let i=0; i<8; i++) {
for (let j=0; j<8; j++) {
const oppCol = V.GetOppCol(color);
for (let i=0; i<8; i++) {
for (let j=0; j<8; j++) {
// 2) Play each opponent's capture, and see if back-captures are possible:
// Lookup table to quickly decide if a move is already in list:
let moveSet = {};
// 2) Play each opponent's capture, and see if back-captures are possible:
// Lookup table to quickly decide if a move is already in list:
let moveSet = {};
oppCaptureMoves.forEach(m => {
// If another opponent capture with same endpoint already processed, skip:
const mHash = "m" + m.end.x + m.end.y;
oppCaptureMoves.forEach(m => {
// If another opponent capture with same endpoint already processed, skip:
const mHash = "m" + m.end.x + m.end.y;
};
V.PlayOnBoard(this.board, justDisappear);
// Can I take on [m.end.x, m.end.y] ? If yes, add to list:
};
V.PlayOnBoard(this.board, justDisappear);
// Can I take on [m.end.x, m.end.y] ? If yes, add to list: