Ajout Grille + Swing UI Grille Sudoku
This commit is contained in:
28
Sudoku.java
Normal file
28
Sudoku.java
Normal file
@@ -0,0 +1,28 @@
|
||||
public class Sudoku {
|
||||
private Grid grid;
|
||||
|
||||
public Sudoku() {
|
||||
this.grid = new Grid(); //grille de base
|
||||
}
|
||||
|
||||
public Grid getGrid() {
|
||||
return grid;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Sudoku sudoku = new Sudoku();
|
||||
sudoku.printGrid(); // Afficher la grille
|
||||
new SudokuUI(sudoku);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user