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

This commit is contained in:
2025-01-28 08:55:58 +01:00
parent e9a77d9826
commit 182f79d4b4
6 changed files with 146 additions and 46 deletions

View File

@@ -46,13 +46,19 @@ public class Sudoku {
return index < getSize() * getSize();
}
public boolean tryPlaceCellSymbol(int x, int y, int value) {
assert (isValidCoords(x, y));
public boolean canBePlaced(int x, int y, int value) {
for (IConstraint constraint : this.constraints) {
if (!constraint.canBePlaced(this, x, y, value)) {
return false;
}
}
return true;
}
public boolean tryPlaceCellSymbol(int x, int y, int value) {
assert (isValidCoords(x, y));
if (!canBePlaced(x, y, value))
return false;
Cell cell = getCell(x, y);
cell.setSymbolIndex(value);
return true;
@@ -293,4 +299,9 @@ public class Sudoku {
return true;
}
public void setBlockWidth(int blockWidth) {
this.blockWidth = blockWidth;
}
}