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
|
// 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
|
// Print the current score
|
||||||
write!(
|
for p in [Piece::White, Piece::Black] {
|
||||||
f,
|
writeln!(f, "{} Score: {}", p.text(), self.count(p))?;
|
||||||
"{}",
|
}
|
||||||
[Piece::White, Piece::Black]
|
|
||||||
.map(|p| format!("{} Score: {}\n", p.text(), self.count(p)))
|
|
||||||
.concat()
|
|
||||||
)?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user