fix othello player skip logic
This commit is contained in:
@@ -53,7 +53,11 @@ impl Game {
|
||||
}
|
||||
} else {
|
||||
println!("Player {} did not make a move!", player_i);
|
||||
// TODO! break, player should not be able to skip a move
|
||||
// players are able to skip a move if they have no valid moves to make
|
||||
assert!(
|
||||
!self.board.possible_moves(player_color).any(|_| true),
|
||||
"Player skipped a move, but they had a possible move to make"
|
||||
);
|
||||
return; // No valid move available
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user