I don't have an undo method. I just make a copy of the board state if I want to be able to go back to that.
How do you undo en-passent squares without remembering something from the previous state?
Moderator: Ras
I don't have an undo method. I just make a copy of the board state if I want to be able to go back to that.
Cool
Congrats! And if at all in doubt, make sure there is 7 moves available for black in following:lojic wrote: ↑Mon Feb 01, 2021 1:37 am I finally implemented perft. I didn't discover any bugs in move generation (although I should've done perft before I painfully debugged my move generation manually by playing games!!), but I fixed a bunch of bugs in my fen parsingOne of them was related to my "piece has moved" bit which the fen parser didn't set properly.
Where do I find this? I don't want to just google it and end up with the wrong one.
For EP squares, I have an array that is indexed by ply. The logic was a bit tricky (possibly due to other aspects of my implementation), but now that I have a nice perft test suite, I'd feel comfortable trying the same thing with castling rights and comparing the speed.
It is here (and many other engines also include it):
I'm relieved to report that all tests on depth 5 and 6 passed!
But now you know for sure that your move generator and make/unmake are bug free.