- // allows() tests whether the 'first' move at previous ply somehow makes the
- // 'second' move possible e.g. if the moving piece is the same in both moves.
- // Normally the second move is the threat (the best move returned from a null
- // search that fails low).
-
- bool allows(const Position& pos, Move first, Move second) {
-
- assert(is_ok(first));
- assert(is_ok(second));
- assert(color_of(pos.piece_on(from_sq(second))) == ~pos.side_to_move());
- assert(type_of(first) == CASTLING || color_of(pos.piece_on(to_sq(first))) == ~pos.side_to_move());
-
- Square m1from = from_sq(first);
- Square m2from = from_sq(second);
- Square m1to = to_sq(first);
- Square m2to = to_sq(second);
-
- // The piece is the same or second's destination was vacated by the first move.
- // We exclude the trivial case where a sliding piece does in two moves what
- // it could do in one move: eg. Ra1a2, Ra2a3.
- if ( m2to == m1from
- || (m1to == m2from && !aligned(m1from, m2from, m2to)))
- return true;
+ // update_stats() updates killers, history, countermoves and followupmoves stats after a fail-high
+ // of a quiet move.