Legality move test
Posted: Sun Jul 06, 2014 1:47 am
Hello!
I'm trying to understand something about legality test in move generation but so far no luck..
I've implemented a move generation with bitboards and now I want to know which of the generated moves are legal.. On my first approach I just make the move and I see if that move resulted in discovered check. This approach is easily implemented, but I found out that is a much faster way to do this. The idea is to calculate a bitboard of absolute pins before move generation to later discard obvious illegal moves. I have implemented this and now on the move generation we need to check for 3 cases: King in single check, King in double check and King not in check. What I can't understand is this:
"Not in Check:
-The moving piece is not absolutely pinned on its move direction" → from chessprogramming wikispaces.
So I have a bitboard of absolute pins, a bitboard of moves for each piece (that are generated with magic bitboards, shift etc..) and I want to know how I check if the moving piece is not absolutely pinned on its move direction (forget the implementation to see if is none, single or double check, I'am focus on not in check). For the move direction I've implemented a "in between" function needed to the absolute pins. Could this help here?
Can someone explain "The moving piece is not absolutely pinned on its move direction" better? for example with pseudo-code?
I'm trying to understand something about legality test in move generation but so far no luck..
I've implemented a move generation with bitboards and now I want to know which of the generated moves are legal.. On my first approach I just make the move and I see if that move resulted in discovered check. This approach is easily implemented, but I found out that is a much faster way to do this. The idea is to calculate a bitboard of absolute pins before move generation to later discard obvious illegal moves. I have implemented this and now on the move generation we need to check for 3 cases: King in single check, King in double check and King not in check. What I can't understand is this:
"Not in Check:
-The moving piece is not absolutely pinned on its move direction" → from chessprogramming wikispaces.
So I have a bitboard of absolute pins, a bitboard of moves for each piece (that are generated with magic bitboards, shift etc..) and I want to know how I check if the moving piece is not absolutely pinned on its move direction (forget the implementation to see if is none, single or double check, I'am focus on not in check). For the move direction I've implemented a "in between" function needed to the absolute pins. Could this help here?
Can someone explain "The moving piece is not absolutely pinned on its move direction" better? for example with pseudo-code?