+
+ // Adjust contempt based on current situation
+ contempt = Options["Contempt"] * PawnValueEg / 100; // From centipawns
+ contempt += bestValue > 500 ? 50: // Dynamic contempt
+ bestValue < -500 ? -50:
+ bestValue / 10;
+
+ Eval::Contempt = (us == WHITE ? make_score(contempt, contempt / 2)
+ : -make_score(contempt, contempt / 2));