feat : logger
Some checks failed
Linux arm64 / Build (push) Has been cancelled

This commit is contained in:
Melvyn
2025-01-28 09:59:51 +01:00
parent b1ae79a2e8
commit ebb3a4c48a
4 changed files with 48 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
package sudoku.structure;
import sudoku.constraint.IConstraint;
import java.util.ArrayList;
import java.util.List;
@@ -60,12 +62,20 @@ public class MultiDoku {
}
public List<Integer> getPossibleSymbolsOfCell(Cell cellToFill) {
for (Sudoku sudoku : this.subGrids) {
if (sudoku.contains(cellToFill)) {
return sudoku.getPossibleSymbolsOfCell(cellToFill);
}
}
return new ArrayList<>();
List<Integer> result = new ArrayList<>();
boolean hasBeenFill = false;
for (Sudoku sudoku : this.subGrids) {
if (sudoku.contains(cellToFill)) {
if (!hasBeenFill) {
result.addAll(sudoku.getPossibleSymbolsOfCell(cellToFill));
hasBeenFill = true;
} else {
result.retainAll(sudoku.getPossibleSymbolsOfCell(cellToFill));
}
}
}
return result;
}
public List<Sudoku> getSubGrids() {