BimmerBass / Loki

C++17 chess engine
GNU General Public License v3.0
9 stars 2 forks source link

Faulty updating of zobrist keys #13

Closed BimmerBass closed 3 years ago

BimmerBass commented 3 years ago

I just implemented a method in GameState_t called is_ok(), that simply checks if the kings are present, if they are at their designated squares etc.. It also computes a zobrist key, and compares it with the incrementally updated one, and it seems that there is a bug here.

I don't know exactly what it is, but i will do some perft tests to see where it is and then I'll try fixing it before v3.0.0.

BimmerBass commented 3 years ago

It turns out, that it was the update of the zobrist key when making a null-move. I had forgotten to XOR out the potential en-passant square (and XOR it in again after the null-move). It has been fixed now.