miguel-ambrona / sherlock

A chess library written in Rust, oriented to creating and solving chess compositions with especial emphasis on retrograde analysis.
MIT License
5 stars 0 forks source link

Redundant en-passant flags in standard FEN #53

Open miguel-ambrona opened 1 month ago

miguel-ambrona commented 1 month ago

Forsyth–Edwards Notation (FEN) has a minor issue: the en-passant flag is always specified after a double-pawn push, even if there is no enemy pawn that can actually capture en-passant.

Task

Modify the conversion routine from Board to RetractableBoard as follows.

If in Board there are no pawns of the side without the turn on their relative 4th rank with an opponent pawn next to them on the same rank (which could potentially capture en-passant), the resulting en_passant flag in the RetractableBoard should be Any.

Please, give it a try!