4 ms·
En passant only needs 3 bits to encode the file ("column") containing the eligible pawn. The rank ("row") is inferred from the context -- whose move it is. (W=5
by BearOfNH 17y ago
En passant only needs 3 bits to encode the file ("column") containing the eligible pawn. The rank ("row") is inferred from the context -- whose move it is. (W=5, B=4)
3 bits always suffice to indicate either (a) a pawn en prise (as it were) or (b) no en passant possible because there's no enemy pawn on the proper square for that file. (You can't have pawns on all 8 files and at the same time have one eligible for en passant capture, since you've got to have an opponent's pawn on an adjacent file. So in the usual case of no en passant you just pick a file not occupied by a pawn of the right color, alternatively one of the right color not adjacent to a pawn of the color to move. This is always possible).