This commit is contained in:
@@ -54,16 +54,15 @@ public class Sudoku {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
int x = i%this.blocks.size();
|
||||
int y = (i-x)/this.blocks.size();
|
||||
int x = i % this.blocks.size();
|
||||
int y = (i - x) / this.blocks.size();
|
||||
int value = values.get(i);
|
||||
if (!this.setCellSymbol(x, y, value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Cell getCell(int x, int y) {
|
||||
int index = y * getSize() + x;
|
||||
@@ -83,6 +82,12 @@ public class Sudoku {
|
||||
return this.blocks.size();
|
||||
}
|
||||
|
||||
public boolean isValid(List<IConstraint> constraints) {
|
||||
// not implemented
|
||||
// for eachcase check contraintes
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<Cell> getCells() {
|
||||
return this.cells;
|
||||
}
|
||||
@@ -149,6 +154,7 @@ public class Sudoku {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Sudoku {");
|
||||
|
||||
Reference in New Issue
Block a user