refact: comments

This commit is contained in:
Henri Bourcereau 2026-03-02 14:48:23 +01:00
parent f4049f548e
commit 4ea4b1249b

View file

@ -343,7 +343,7 @@ impl MoveRules {
return Err(MoveError::ExitByEffectPossible); return Err(MoveError::ExitByEffectPossible);
} }
// - la dame choisie doit être la plus éloignée de la sortie // The chosen checker must be the farthest from exit
// For chained moves (tout d'une), we need to check the board state AFTER the first move // For chained moves (tout d'une), we need to check the board state AFTER the first move
let board_to_check = if moves.0.get_to() == moves.1.get_from() { let board_to_check = if moves.0.get_to() == moves.1.get_from() {
// Chained move: apply first move to get the board state // Chained move: apply first move to get the board state
@ -367,9 +367,8 @@ impl MoveRules {
if has_filled_quarter { if has_filled_quarter {
// When a quarter is filled, we can only exit from fields with >2 checkers // When a quarter is filled, we can only exit from fields with >2 checkers
// Find the farthest field with >2 checkers (removing one won't break the quarter) // Find the farthest field with >2 checkers (removing one won't break the quarter)
let mut available_checkers: Vec<_> = checkers.iter() let mut available_checkers: Vec<_> =
.filter(|(_, count)| *count > 2) checkers.iter().filter(|(_, count)| *count > 2).collect();
.collect();
if !available_checkers.is_empty() { if !available_checkers.is_empty() {
// Use the farthest available checker (that won't break the quarter) // Use the farthest available checker (that won't break the quarter)
@ -409,7 +408,7 @@ impl MoveRules {
} }
} }
// s'il reste au moins deux dames, on vérifie que les plus éloignées soint choisies // s'il reste au moins deux dames, on vérifie que les plus éloignées soient choisies
if has_two_checkers || has_filled_quarter { if has_two_checkers || has_filled_quarter {
if moves.0.get_to() == 0 && moves.1.get_to() == 0 { if moves.0.get_to() == 0 && moves.1.get_to() == 0 {
// Deux coups sortants en excédant // Deux coups sortants en excédant