This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user