rewrite basically done
This commit is contained in:
15
src/game.rs
15
src/game.rs
@@ -92,11 +92,16 @@ impl Game {
|
||||
|
||||
println!("{}", self);
|
||||
|
||||
if let Some(game_winner) = self.board.game_winner(self.players[current_player].color())
|
||||
{
|
||||
println!("{} Wins!", game_winner.text());
|
||||
// end the game
|
||||
break;
|
||||
match self.board.game_winner(self.players[current_player].color()) {
|
||||
crate::board::Winner::Player(piece) => {
|
||||
println!("{} Wins!", piece.text());
|
||||
break;
|
||||
}
|
||||
crate::board::Winner::Tie => {
|
||||
println!("Game Tied!");
|
||||
break;
|
||||
}
|
||||
crate::board::Winner::None => {}
|
||||
}
|
||||
|
||||
self.step(current_player);
|
||||
|
||||
Reference in New Issue
Block a user