From c0334c7bac92fe0569dc61d1af63a8cc07e2020f Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 7 May 2010 11:36:25 +0200 Subject: [PATCH] Rename AttackWeight[] in KingAttackWeights[] Also simplify a bit the code removing useless named constants. No functional change. --- src/evaluate.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index ac240f05..1036b479 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -203,13 +203,8 @@ namespace { /// the strength of the enemy attack are added up into an integer, which /// is used as an index to KingDangerTable[]. - // Attack weights for each piece type and table indexed on piece type - const int QueenAttackWeight = 5; - const int RookAttackWeight = 3; - const int BishopAttackWeight = 2; - const int KnightAttackWeight = 2; - - const int AttackWeight[] = { 0, 0, KnightAttackWeight, BishopAttackWeight, RookAttackWeight, QueenAttackWeight }; + // KingAttackWeights[] contains king attack weights by piece type + const int KingAttackWeights[8] = { 0, 0, 2, 2, 3, 5 }; // Bonuses for enemy's safe checks const int QueenContactCheckBonus = 3; @@ -554,7 +549,7 @@ namespace { if (b & ei.kingZone[Us]) { ei.kingAttackersCount[Us]++; - ei.kingAttackersWeight[Us] += AttackWeight[Piece]; + ei.kingAttackersWeight[Us] += KingAttackWeights[Piece]; Bitboard bb = (b & ei.attackedBy[Them][KING]); if (bb) ei.kingAdjacentZoneAttacksCount[Us] += count_1s_max_15(bb); -- 2.39.2