OK, I have this chess app built with bitboard and I want to check if a given move put the opponent pieces in checkmate.
Verifying a check situation is easy. You build the bitmask of the enemy pieces' attack and you AND
that with the bitmask of the opposite king, if the result is not zero, you have a check.
But what about check mate? A checkmate is something that will happen after the check. I mean, I move a piece, the app detects that the move generated a check. Then how do I know if this check is a check mate? Do I have to generate all possible bitboards for all possible plays of the opponent and check if there is a move that can remove the king from check? This not appears to be practical. Is there another way?
I don't think there is any other way. The final algorithm to me looks like: