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.
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.
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
toRetractableBoard
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 theRetractableBoard
should beAny
.Please, give it a try!