feat: dynamic constraints (Fixes #8)
All checks were successful
Linux arm64 / Build (push) Successful in 37s

This commit is contained in:
2025-01-29 17:19:44 +01:00
parent 5e26bea609
commit c16f2b8f5a
12 changed files with 311 additions and 149 deletions

View File

@@ -9,12 +9,12 @@ public class DiagonalConstraint implements IConstraint {
if (x == y) {
for (int i = 0; i < s.getSize(); i++) {
if (s.getCell(i, i).getSymbolIndex() == newSymbolIndex)
return false;
return false;
}
} else if (s.getSize() - x == y) {
for (int i = 0; i < s.getSize(); i++) {
if (s.getCell(s.getSize() - i, i).getSymbolIndex() == newSymbolIndex)
return false;
if (s.getCell(s.getSize() - i - 1, i).getSymbolIndex() == newSymbolIndex)
return false;
}
}
// not in diagonal