To reproduce, just run this branch and you should see the following exception:
I dug through it a little and it appears to originate from line 60 of my code, where I call board.MakeMove, but only when coming from the method MoveWouldLoseQueen. I use it all over the place otherwise with no issue.
The thing is, I'm only ever passing legal moves provided by the library.
I ran into this when I was implementing some simple heuristics around queen losses.
I have a branch here that runs into this issue every time it runs:
https://github.com/b4ux1t3/Seb-Lague-Chess-Challenge/tree/bug-in-library-queen-check
To reproduce, just run this branch and you should see the following exception:
I dug through it a little and it appears to originate from line 60 of my code, where I call
board.MakeMove
, but only when coming from the methodMoveWouldLoseQueen
. I use it all over the place otherwise with no issue.The thing is, I'm only ever passing legal moves provided by the library.