]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Use range-based-for in late join
[stockfish] / src / evaluate.cpp
index 8f4eb32f5789f4794e2b9d293a22dbfa8a5611fa..6c46cb4b78e3d393142738a37449e11c7e02f012 100644 (file)
@@ -412,10 +412,10 @@ namespace {
         // attacked and undefended squares around our king and the quality of
         // the pawn shelter (current 'score' value).
         attackUnits =  std::min(74, ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them])
-                     + 8 * ei.kingAdjacentZoneAttacksCount[Them]
+                     +  8 * ei.kingAdjacentZoneAttacksCount[Them]
                      + 25 * popcount<Max15>(undefended)
-                     +  11 * (ei.pinnedPieces[Us] != 0)
-                     - mg_value(score) * 31 / 256
+                     + 11 * (ei.pinnedPieces[Us] != 0)
+                     - mg_value(score) / 8
                      - !pos.count<QUEEN>(Them) * 60;
 
         // Analyse the enemy's safe queen contact checks. Firstly, find the
@@ -553,7 +553,7 @@ namespace {
     b &=  ~pos.pieces()
         & ~ei.attackedBy[Them][PAWN]
         & (ei.attackedBy[Us][ALL_PIECES] | ~ei.attackedBy[Them][ALL_PIECES]);
-    
+
     if (b)
         score += popcount<Full>(b) * PawnSafePush;
 
@@ -904,14 +904,14 @@ namespace Eval {
 
   void init() {
 
-    const int MaxSlope = 87;
-    const int Peak = 12800;
+    const int MaxSlope = 8700;
+    const int Peak = 1280000;
     int t = 0;
 
     for (int i = 0; i < 400; ++i)
     {
-        t = std::min(Peak, std::min(i * i * 27 / 100, t + MaxSlope));
-        KingDanger[i] = apply_weight(make_score(t / 10, 0), Weights[KingSafety]);
+        t = std::min(Peak, std::min(i * i * 27, t + MaxSlope));
+        KingDanger[i] = apply_weight(make_score(t / 1000, 0), Weights[KingSafety]);
     }
   }