cargo fmt
This commit is contained in:
parent
352e853beb
commit
3d622394a0
13
src/board.rs
13
src/board.rs
@ -37,7 +37,11 @@ impl fmt::Display for Board {
|
|||||||
|
|
||||||
// Print the current score
|
// Print the current score
|
||||||
let (white_score, black_score) = self.get_score();
|
let (white_score, black_score) = self.get_score();
|
||||||
writeln!(f, "White Score: {}\nBlack Score: {}", white_score, black_score)?;
|
writeln!(
|
||||||
|
f,
|
||||||
|
"White Score: {}\nBlack Score: {}",
|
||||||
|
white_score, black_score
|
||||||
|
)?;
|
||||||
|
|
||||||
// Print game over screen
|
// Print game over screen
|
||||||
if self.game_over() == true {
|
if self.game_over() == true {
|
||||||
@ -50,8 +54,6 @@ impl fmt::Display for Board {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Board {
|
impl Board {
|
||||||
@ -208,12 +210,10 @@ impl Board {
|
|||||||
if white_score > black_score {
|
if white_score > black_score {
|
||||||
Some(Piece::White)
|
Some(Piece::White)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Black Wins
|
// Black Wins
|
||||||
else if black_score > white_score {
|
else if black_score > white_score {
|
||||||
Some(Piece::Black)
|
Some(Piece::Black)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tie
|
// Tie
|
||||||
else {
|
else {
|
||||||
None
|
None
|
||||||
@ -227,8 +227,7 @@ impl Board {
|
|||||||
|
|
||||||
if max_score == combined_score {
|
if max_score == combined_score {
|
||||||
true
|
true
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user