- Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),
- Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),
- Value(0),Value(0),Value(5),Value(5),Value(5),Value(5),Value(0),Value(0),
- Value(0),Value(5),Value(10),Value(10),Value(10),Value(10),Value(5),Value(0),
- Value(0),Value(10),Value(20),Value(20),Value(20),Value(20),Value(10),Value(0),
- Value(0),Value(5),Value(8),Value(8),Value(8),Value(8),Value(5),Value(0),
- Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),
- Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0),Value(0)
+ // A B C D E F G H
+ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // 1
+ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // 2
+ V(0), V(0), V(5), V(5), V(5), V(5), V(0), V(0), // 3
+ V(0), V(5),V(10),V(10),V(10),V(10), V(5), V(0), // 4
+ V(0),V(10),V(21),V(21),V(21),V(21),V(10), V(0), // 5
+ V(0), V(5), V(8), V(8), V(8), V(8), V(5), V(0), // 6
+ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // 7
+ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) // 8
+ };
+
+ // ThreatBonus[][] contains bonus according to which piece type
+ // attacks which one.
+ #define Z make_score(0, 0)
+
+ const Score ThreatBonus[8][8] = {
+ { Z, Z, Z, Z, Z, Z, Z, Z }, // not used
+ { Z, S(18,37), Z, S(37,47), S(55,97), S(55,97), Z, Z }, // KNIGHT attacks
+ { Z, S(18,37), S(37,47), Z, S(55,97), S(55,97), Z, Z }, // BISHOP attacks
+ { Z, S( 9,27), S(27,47), S(27,47), Z, S(37,47), Z, Z }, // ROOK attacks
+ { Z, S(27,37), S(27,37), S(27,37), S(27,37), Z, Z, Z }, // QUEEN attacks
+ { Z, Z, Z, Z, Z, Z, Z, Z }, // not used
+ { Z, Z, Z, Z, Z, Z, Z, Z }, // not used
+ { Z, Z, Z, Z, Z, Z, Z, Z } // not used