fix constraints
All checks were successful
Linux arm64 / Build (push) Successful in 5m12s

This commit is contained in:
2025-01-23 10:37:50 +01:00
parent 6c8bfad18d
commit 48fc88d8ab
2 changed files with 2 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ public class ColumnConstraint implements IConstraint {
@Override
public boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex) {
for (int i = 0; i < s.getSize(); i++) {
if (s.getCell(x, newSymbolIndex).getSymbolIndex() == newSymbolIndex)
if (s.getCell(x, i).getSymbolIndex() == newSymbolIndex)
return false;
}
return true;

View File

@@ -7,7 +7,7 @@ public class LineConstraint implements IConstraint {
@Override
public boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex) {
for (int i = 0; i < s.getSize(); i++) {
if (s.getCell(newSymbolIndex, y).getSymbolIndex() == newSymbolIndex)
if (s.getCell(i, y).getSymbolIndex() == newSymbolIndex)
return false;
}
return true;