fix build
All checks were successful
Linux arm64 / Build (push) Successful in 52s

This commit is contained in:
2025-01-21 19:28:53 +01:00
parent 4e33318ba0
commit 3a69139798
4 changed files with 14 additions and 12 deletions

View File

@@ -17,11 +17,6 @@ public class MutableCell extends Cell{
this.possibleSymbols = new ArrayList<>();
}
public MutableCell(MutableCell currentCell) {
super(currentCell);
this.possibleSymbols = currentCell.getPossibleSymbols();
}
public void setSymbolIndex(int symbolIndex) {
this.symbolIndex = symbolIndex;
}

View File

@@ -29,9 +29,10 @@ public class SudokuFactory {
for (int x = 0; x < width; x++) {
int index = ((y + blockY * height) * size + (x + blockX * width));
Cell blockCell = cells.get(index);
List<Block> blockContainers = new ArrayList<>();
blockContainers.add(newBlock);
blockCell.setBlockContainers(blockContainers);
blockCell.setBlock(newBlock);
// List<Block> blockContainers = new ArrayList<>();
// blockContainers.add(newBlock);
// blockCell.setBlockContainers(blockContainers);
newBlock.addCell(blockCell);
}
}

View File

@@ -31,7 +31,7 @@ public class Solver {
int symbol = currentCell.getPossibleSymbols().get(0);
currentCell.setSymbolIndex(symbol);
stack.push(new MutableCell(currentCell));
// stack.push(new MutableCell(currentCell));
try {
doku.updateSymbolsPossibilities();
} catch (Exception e) {

View File

@@ -2,6 +2,8 @@ package sudoku;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Random;
import org.junit.jupiter.api.Test;
import sudoku.io.SudokuPrinter;
@@ -19,9 +21,13 @@ public class SudokuSerializerTest {
@Test
void testSerialize() {
int blockWidth = 3;
int blockHeight = 3;
testSerializeWithSize(blockWidth, blockHeight);
int testCount = 5;
Random r = new Random();
for (int i = 0; i < testCount; i++) {
int blockWidth = r.nextInt(20) + 1;
int blockHeight = r.nextInt(20) + 1;
testSerializeWithSize(blockWidth, blockHeight);
}
}
}