update clear function in multidoku + solver soolve
Some checks failed
Linux arm64 / Build (push) Failing after 23s

This commit is contained in:
Janet-Doe
2025-01-10 17:17:21 +01:00
parent e2c8253f4a
commit 5a07f9347c
2 changed files with 10 additions and 5 deletions

View File

@@ -21,13 +21,18 @@ public class MutableCell extends Cell{
this.symboleIndex = symboleIndex;
}
public void clear() {
/**
* Remove the current symboleIndex and returns it
* @return integer symboleIndex cleared
*/
public int clear() {
int i = this.symboleIndex;
setSymboleIndex(NOSYMBOLE);
return i;
}
public void clear(int indexSymbol) {
public void removeHint(int indexSymbol) {
hintsSymbolIndex.remove(indexSymbol);
this.clear();
}
public List<Integer> getHints() {

View File

@@ -27,8 +27,8 @@ public class Solver {
int indexCurrentCell = rand.nextInt(remainingCellsToCheck.size());
MutableCell currentCell = remainingCellsToCheck.get(indexCurrentCell);
if (currentCell.getHints().isEmpty()){
MutableCell modify = allMutableCells.get(stack.undo());
modify.clear(modify.getSymboleIndex());
MutableCell modify = stack.undo();
modify.removeHint(modify.clear());
}