fix: allowed moves infinite loop

This commit is contained in:
Henri Bourcereau 2025-01-26 17:52:57 +01:00
parent 38100a61b2
commit 6478f5043d
8 changed files with 160 additions and 64 deletions

View file

@ -56,7 +56,7 @@ impl BotStrategy for DefaultStrategy {
fn choose_move(&self) -> (CheckerMove, CheckerMove) {
let rules = MoveRules::new(&self.color, &self.game.board, self.game.dice);
let possible_moves = rules.get_possible_moves_sequences(true);
let possible_moves = rules.get_possible_moves_sequences(true, vec![]);
let choosen_move = *possible_moves
.first()
.unwrap_or(&(CheckerMove::default(), CheckerMove::default()));