Merge branch 'constraint'
All checks were successful
Linux arm64 / Build (push) Successful in 4m2s

This commit is contained in:
2025-02-01 22:29:03 +01:00
8 changed files with 119 additions and 59 deletions

View File

@@ -45,7 +45,7 @@ public class ConsoleInterface {
System.out.println("Your sudoku will have blocks of a " + width + " x " + height + " format.");
int numberOfSymbols = width * height;
List<String> listSymbols = pickSymbols(numberOfSymbols);
List<Constraint> listConstraints = getListConstraints();
List<IConstraint> listConstraints = getListConstraints();
System.out.println("Now that we have the size of our sudoku, " +
"would you rather have a single grid ('one', default), " +
"or a a multidoku composed of 5 subgrids ('multi') ?");
@@ -171,12 +171,12 @@ public class ConsoleInterface {
}
}
private List<Constraint> getListConstraints() {
List<Constraint> listConstraints = SudokuFactory.DEFAULT_CONSTRAINTS;
private List<IConstraint> getListConstraints() {
List<IConstraint> listConstraints = SudokuFactory.DEFAULT_CONSTRAINTS;
System.out.println(
"The sudoku have constraints of blocks, lines and columns. Would you like to add the diagonal constraints ? (y/n, default 'no')");
if (reader.next().equalsIgnoreCase("y")) {
listConstraints.add(Constraint.Diagonal);
listConstraints.add(Constraint.Diagonal.getConstraint());
}
return listConstraints;
}