From: Marco Costalba Date: Sat, 14 Feb 2015 14:55:11 +0000 (+0100) Subject: Further simplify KingDanger init X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=20a5c07472bf04f5d684141a09c120e9beaa54d4;ds=sidebyside Further simplify KingDanger init And remove a tale whitespace while there. No functional change. --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 9d19ad75..18f5adc4 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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(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]); } }