+ .filter(m => {
+ // Filter promotions: keep only one, since no choice now.
+ if (m.appear[0].p != m.vanish[0].p) {
+ const hash = V.CoordsToSquare(m.start) + V.CoordsToSquare(m.end);
+ if (!movesHash[hash]) {
+ movesHash[hash] = true;
+ return true;
+ }
+ return false;
+ }
+ return true;
+ })