feat: dynamic constraints (Fixes #8)
All checks were successful
Linux arm64 / Build (push) Successful in 37s
All checks were successful
Linux arm64 / Build (push) Successful in 37s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user