fix othello player skip logic
This commit is contained in:
@@ -196,7 +196,10 @@ impl Board {
|
||||
}
|
||||
|
||||
pub fn game_winner(&self, turn: Piece) -> Option<Piece> {
|
||||
if self.possible_moves(turn).count() > 0 {
|
||||
// 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()
|
||||
{
|
||||
// player can still make a move, there is no winner
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user