merge
Some checks failed
Linux arm64 / Build (push) Failing after 20s

This commit is contained in:
Janet-Doe
2025-01-21 19:10:06 +01:00
parent 963cea897c
commit 4bd55d4ce4
9 changed files with 151 additions and 37 deletions

View File

@@ -7,7 +7,7 @@ import java.util.List;
/**
* @class Sudoku
* @brief Représente une grille de sudoku avec N symboles
* @brief Represents a sudoku
*/
public class Sudoku {
@@ -39,10 +39,10 @@ public class Sudoku {
return this.blocks.size();
}
public Boolean isValid(List<IConstraint> constraints) {
public boolean isValid(List<IConstraint> constraints) {
//not implemented
//for eachcase check contraintes
throw new Error("Function isValid() not implemented");
return false;
}
public List<Cell> getCells() {
@@ -100,7 +100,11 @@ public class Sudoku {
} catch (Exception e) {
throw new RuntimeException(e);
}
constraint.getPossibleSymbols(this, coord.getX(), coord.getY());
List<Integer> newPossibleSymbols = cell.getPossibleSymbols();
newPossibleSymbols.retainAll(constraint.getPossibleSymbols(this, coord.getX(), coord.getY()));
cell.setPossibleSymbols(newPossibleSymbols);
if (cell.getPossibleSymbols().isEmpty()){
throw new Exception("Rollback bitch");
}