beaucoup
All checks were successful
Linux arm64 / Build (push) Successful in 1m47s

This commit is contained in:
2025-01-10 14:47:20 +01:00
parent 34cf7b5da8
commit 09ba8c00cb
13 changed files with 147 additions and 46 deletions

View File

@@ -0,0 +1,22 @@
package sudoku.constraint;
import java.util.ArrayList;
import java.util.List;
import sudoku.Sudoku;
public interface IConstraint {
boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex);
default List<Integer> getPossibleSymbols(final Sudoku s, int x, int y) {
List<Integer> possibilities = new ArrayList<>();
for (int i = 0; i < s.getSize(); i++) {
if (canBePlaced(s, x, y, i)) {
possibilities.add(i);
}
}
return possibilities;
}
}