37 lines
870 B
Java
Raw Normal View History

2024-04-28 01:40:14 +02:00
public class Sudoku {
private Grid grid;
private boolean solved;
2024-04-28 01:40:14 +02:00
public Sudoku() {
this.grid = new Grid(); // Initialiser avec une grille vide
this.solved = false;
2024-04-28 01:40:14 +02:00
}
2024-04-28 01:40:14 +02:00
public Grid getGrid() {
return grid;
}
public void setGrid(Grid newGrid) {
this.grid = newGrid;
}
public boolean isSolved() {
return solved;
}
public void loadGridFromFile(String fileName) {
this.grid.loadGridFromFile(fileName);
}
public void printGrid() {
for (int row = 0; row < 9; row++) {
for (int col = 0; col < 9; col++) {
int value = grid.getCell(row, col).getValue();
System.out.print(value + " ");
}
System.out.println(); // Passer à la ligne suivante après chaque ligne de la grille
}
}
}