+ if (
+ (this.movesCount >= 2 || j != 4 || ![0, 8].includes(i)) &&
+ (!horizontalStepOnGoalRow || j != 4)
+ ) {
+ moves.push(super.getBasicMove(bp, [i, j]));
+ }
+ } while (true);
+ }
+ }
+ // Try the other direction (TODO: experimental)
+ [i, j] = [bp[0] - 2*step[0], bp[1] - 2*step[1]];
+ if (
+ emptySquare(i, j) &&
+ (this.movesCount >= 2 || j != 4 || ![0, 8].includes(i)) &&
+ (!horizontalStepOnGoalRow || j != 4)
+ ) {
+ moves.push(super.getBasicMove(bp, [i, j]));
+ if (!oneStep) {
+ do {
+ i -= step[0];
+ j -= step[1];
+ if (!emptySquare(i, j)) break;
+ if (
+ (this.movesCount >= 2 || j != 4 || ![0, 8].includes(i)) &&
+ (!horizontalStepOnGoalRow || j != 4)
+ ) {