feat : solver random
Some checks are pending
Linux arm64 / Build (push) Waiting to run

This commit is contained in:
Melvyn
2025-01-27 14:48:28 +01:00
parent 3bb610b9c2
commit 80239274d7
6 changed files with 74 additions and 51 deletions

View File

@@ -229,8 +229,9 @@ public class Sudoku {
} catch (Exception e) {
return result;
}
for (IConstraint constraint : this.constraints) {
if (result.isEmpty()) {
for (int i = 0; i < this.constraints.size(); i++) {
IConstraint constraint = this.constraints.get(i);
if (i == 0) {
result.addAll(constraint.getPossibleSymbols(this, cellCoordinates.getX(), cellCoordinates.getY()));
} else {
result.retainAll(constraint.getPossibleSymbols(this, cellCoordinates.getX(), cellCoordinates.getY()));