Hello!
Right now for generating legal moves based on a bitboard of en-passant pseudo-legal moves I do an "is king in check after move" validation, but this is slow. Theres a much faster way by calculating all the pins even en-passant pins.
In cpw they explain how this legality test is made:
"for strict legality, the ep capturing pawn should not be absolutely pinned, which additionally requires a horizontal pin test of both involved pawns, which disappear from the same rank"
and I understand that ^ .but I don't have any idea how I can calculate the pinned pawns since there are one opposite colour pawn in the same rank and therefore they are not really pinned.
For example in this position:
8/6bb/8/8/R1pP2k1/4P3/P7/K7 b - d3
The pawn on c4 after d2-d4 is "pinned" for the en-passant move but not pinned for the push move!
To find pinned pieces, I generate the rook moves from king square and then i intercept them with our pieces to find the pieces that can pin. After this I calculate the xrays but it will fail because of a second pawn blocking rook rays attacks and will not find the pinned pawn.
Any ideas to do this legality test?
