Board: formatting code improvement
This commit is contained in:
parent
8b50273b43
commit
9ab583a57e
@ -120,16 +120,12 @@ impl fmt::Display for Board {
|
||||
}
|
||||
|
||||
// put a line at the bottom of the board too
|
||||
writeln!(f, " {}", HORIZ_SEP_LINE)?;
|
||||
writeln!(f, "{}{}", SPACE_PADDING, HORIZ_SEP_LINE)?;
|
||||
|
||||
// Print the current score
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
[Piece::White, Piece::Black]
|
||||
.map(|p| format!("{} Score: {}\n", p.text(), self.count(p)))
|
||||
.concat()
|
||||
)?;
|
||||
for p in [Piece::White, Piece::Black] {
|
||||
writeln!(f, "{} Score: {}", p.text(), self.count(p))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user