feat : mixedSolve
All checks were successful
Linux arm64 / Build (push) Successful in 37s

This commit is contained in:
Melvyn
2025-01-30 14:32:15 +01:00
parent 44a4432ac0
commit d6c3504bc7
2 changed files with 88 additions and 57 deletions

View File

@@ -1,9 +1,6 @@
package sudoku.structure;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
import sudoku.io.SudokuSerializer;
@@ -170,4 +167,15 @@ public class MultiDoku {
return stateManager;
}
/**
* Renvoie une Cell vide choisie aléatoirement.
*
* @param rand Random, pour le choix aléatoire.
* @return Cell, une Cell vide.
*/
public Cell getRandomEmptyCell(Random rand) {
List<Cell> emptyCells = getEmptyCells();
int randomIndex = rand.nextInt(emptyCells.size());
return emptyCells.get(randomIndex);
}
}