fix othello player skip logic

This commit is contained in:
2025-02-10 10:23:28 -05:00
parent 3d3eb01143
commit 0bd8dec65d
5 changed files with 18 additions and 7 deletions

View File

@@ -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
}
}