]> git.sesse.net Git - stockfish/commitdiff
Further simplify KingDanger init
authorMarco Costalba <mcostalba@gmail.com>
Sat, 14 Feb 2015 14:55:11 +0000 (15:55 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 14 Feb 2015 14:56:54 +0000 (15:56 +0100)
And remove a tale whitespace while there.

No functional change.

src/evaluate.cpp

index 9d19ad75c7541dbb53836525c56bdf446783b025..18f5adc4084c9f9132d59230f76a24eccf297416 100644 (file)
@@ -555,7 +555,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;
 
@@ -917,14 +917,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]);
     }
   }