]> git.sesse.net Git - stockfish/commit
make DistanceRing more consistent
authorprotonspring <mike@whiteley.org>
Mon, 20 Aug 2018 16:29:46 +0000 (10:29 -0600)
committerStéphane Nicolet <cassio@free.fr>
Tue, 28 Aug 2018 23:07:38 +0000 (01:07 +0200)
commit8a4821923ac6860c791185a6d25c60ad0391739f
tree84b3ea622237943212522aa1d2119a95fc61d20c
parent6307fd08e6e8c315802301fd35b22ca2a67071a9
make DistanceRing more consistent

This is a non-functional change. By pre-incrementing minKingPawnDistance
instead of post-incrementing, we can remove this -1.

This also makes DistanceRing more consistent with the rest of stockfish
since it now holds an actual "distance" instead of a less natural distance-1.

In current master, PseudoAttacks[KING][ksq] == DistanceRingBB[ksq][0]
With this patch, it will be PseudoAttacks[KING][ksq] == DistanceRingBB[ksq][1]
ie squares at distance 1 from the king. This is more natural use of distance.

The current array size DistanceRingBB[SQUARE_NB][8] is still OK with the new
definition, because maximum distance between two squares on a chess board is
seven (for example Kh1 and a8).

No functional change.
src/bitboard.cpp
src/pawns.cpp