Board::game_winner: remove unneeded argument
This commit is contained in:
@@ -324,10 +324,11 @@ impl Board {
|
||||
}
|
||||
|
||||
/// Returns the winner of the board (if any)
|
||||
pub fn game_winner(&self, turn: Piece) -> Winner {
|
||||
pub fn game_winner(&self) -> Winner {
|
||||
// Wikipedia: `Players take alternate turns. If one player cannot make a valid move, play passes back to the other player. The game ends when the grid has filled up or if neither player can make a valid move.`
|
||||
|
||||
if self.possible_moves(turn).next().is_some() || self.possible_moves(!turn).next().is_some()
|
||||
if self.possible_moves(Piece::Black).next().is_some()
|
||||
|| self.possible_moves(Piece::White).next().is_some()
|
||||
{
|
||||
// player can still make a move, there is no winner
|
||||
return Winner::None;
|
||||
|
||||
Reference in New Issue
Block a user