Closed fanzier closed 5 years ago
Yeah. Do you think it's a bad idea to impl Display for Board { ... } where the result is the FEN string? I think that would be the most "sane" implementation.
To put it another way, if you execute println!("{}", board) or format!("{}", board), it "feels" like I should get an FEN string back to me.
I think a Display impl returning the FEN string would be a good solution. It's standard, compact and contains all the information.
impl Display for Board
is now completed. Not on https://crates.io/crates/chess/ yet, but should be soon.
Great, thank you for implementing this! :)
Released in 3.1.0.
It would make debugging way easier if there was a way to convert a Board into a human-readable string or at least a FEN string (which is somewhat human-readable). I think the library once contained a
Display
implementation forBoard
but that seems to have been removed.I would suggest adding a method
Board::to_fen(&self) -> String
that converts the board to a FEN string but I'm open to other proposals.