Closed andreij closed 4 years ago
@jmogilner Thanks for your suggestion to improve tests, it turned out w1r
isn't the king side rook as I wrongly supposed but the first rook found in the chessboard. So I've refactored code accordingly.
Have you verified that the code works correctly for Fischer random chess castling? https://en.wikipedia.org/wiki/Fischer_random_chess#Castling_rules
I don't think that this will work for chess960. Can you please create a test based on the example I shared in the link below?
@marcosdsanchez Thanks for heads up, reverted in #39
In case of odds game or games with custom FEN such as
q3k2q/pbpqppbp/1pnp1np1/8/8/1PNP1NP1/PBPQPPBP/Q3K2Q w KQkq - 2 9
check that there are actually rooks in the board to decide if a king can castle or not.