Skip to content

Commit

Permalink
chore: make Board implement Display
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Apr 3, 2024
1 parent 572fe31 commit bb19786
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ataxx/src/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ impl FromStr for Board {
}
}

impl fmt::Display for Board {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.current_pos())
}
}

impl Board {
/// generate_moves generates the legal Moves present in the current Position
/// on the Board into a [MoveList] and returns it. It is a wrapper on top of
Expand Down

0 comments on commit bb19786

Please sign in to comment.