ANGLICHE
All checks were successful
Linux arm64 / Build (push) Successful in 34s

This commit is contained in:
2025-01-10 16:14:52 +01:00
parent 77c0b0d41b
commit 8cd0f6fa12
8 changed files with 68 additions and 74 deletions

View File

@@ -8,29 +8,22 @@ import java.util.List;
*/
public class Sudoku {
private final List<Bloc> blocs;
private final List<Case> cases;
private final List<Block> blocks;
private final List<Cell> cells;
public Sudoku(List<Case> cases, List<Bloc> blocs) {
// assert(symbolCount >= 2);
// // initialisation des cases
// this.cases = new ArrayList<>(symbolCount * symbolCount);
// Collections.fill(this.cases, new Case());
// // initialisation des blocs
// this.blocs = new ArrayList<>(symbolCount);
// Collections.fill(this.blocs, new Bloc(null));
this.cases = cases;
this.blocs = blocs;
public Sudoku(List<Cell> cells, List<Block> blocks) {
this.cells = cells;
this.blocks = blocks;
}
public Case getCase(int x, int y) {
public Cell getCell(int x, int y) {
int index = y * getSize() + x;
assert(index < getSize() * getSize());
return this.cases.get(index);
return this.cells.get(index);
}
public int getSize() {
return this.blocs.size();
return this.blocks.size();
}
}