+ getAllValidMoves() {
+ const moves = this.filterValid(super.getAllPotentialMoves());
+ if (this.movesCount % 4 <= 1) return moves;
+ const emptyIdx = moves.findIndex(m => m.vanish.length == 0);
+ if (emptyIdx >= 0)
+ // Keep only one pass move (for computer play)
+ return moves.filter((m, i) => m.vanish.length > 0 || i == emptyIdx);
+ return moves;
+ }
+
+ play(move, noFlag) {