+ void update_continuation_histories(Stack* ss, Piece pc, Square to, int bonus) {
+
+ for (int i : {1, 2, 4})
+ if (is_ok((ss-i)->currentMove))
+ (ss-i)->contHistory->update(pc, to, bonus);
+ }
+
+
+ // update_capture_stats() updates move sorting heuristics when a new capture best move is found
+
+ void update_capture_stats(const Position& pos, Move move,
+ Move* captures, int captureCnt, int bonus) {
+
+ CapturePieceToHistory& captureHistory = pos.this_thread()->captureHistory;
+ Piece moved_piece = pos.moved_piece(move);
+ PieceType captured = type_of(pos.piece_on(to_sq(move)));
+ captureHistory.update(moved_piece, to_sq(move), captured, bonus);
+
+ // Decrease all the other played capture moves
+ for (int i = 0; i < captureCnt; ++i)
+ {
+ moved_piece = pos.moved_piece(captures[i]);
+ captured = type_of(pos.piece_on(to_sq(captures[i])));
+ captureHistory.update(moved_piece, to_sq(captures[i]), captured, -bonus);
+ }
+ }
+
+
+ // update_quiet_stats() updates move sorting heuristics when a new quiet best move is found
+
+ void update_quiet_stats(const Position& pos, Stack* ss, Move move,
+ Move* quiets, int quietsCnt, int bonus) {