- // Weakness of our pawn shelter in front of the king by [distance from edge][rank]
- const Value ShelterWeakness[][RANK_NB] = {
- { V(100), V(20), V(10), V(46), V(82), V( 86), V( 98) },
- { V(116), V( 4), V(28), V(87), V(94), V(108), V(104) },
- { V(109), V( 1), V(59), V(87), V(62), V( 91), V(116) },
- { V( 75), V(12), V(43), V(59), V(90), V( 84), V(112) }
+ // Weakness of our pawn shelter in front of the king by [isKingFile][distance from edge][rank].
+ // RANK_1 = 0 is used for files where we have no pawns or our pawn is behind our king.
+ const Value ShelterWeakness[][int(FILE_NB) / 2][RANK_NB] = {
+ { { V( 97), V(17), V( 9), V(44), V( 84), V( 87), V( 99) }, // Not On King file
+ { V(106), V( 6), V(33), V(86), V( 87), V(104), V(112) },
+ { V(101), V( 2), V(65), V(98), V( 58), V( 89), V(115) },
+ { V( 73), V( 7), V(54), V(73), V( 84), V( 83), V(111) } },
+ { { V(104), V(20), V( 6), V(27), V( 86), V( 93), V( 82) }, // On King file
+ { V(123), V( 9), V(34), V(96), V(112), V( 88), V( 75) },
+ { V(120), V(25), V(65), V(91), V( 66), V( 78), V(117) },
+ { V( 81), V( 2), V(47), V(63), V( 94), V( 93), V(104) } }