Ajout Grille + Swing UI Grille Sudoku

This commit is contained in:
Vincent
2024-04-28 01:40:14 +02:00
commit a13d298097
6 changed files with 240 additions and 0 deletions

30
Grid.java Normal file
View File

@@ -0,0 +1,30 @@
public class Grid {
private Cell[][] cells;
public Grid() {
cells = new Cell[9][9];
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
cells[i][j] = new Cell();
}
}
}
public Grid(Grid grid) {
cells = new Cell[9][9];
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
cells[i][j] = new Cell(grid.cells[i][j].getValue());
}
}
}
public Cell getCell(int ligne, int col) {
return cells[ligne][col];
}
}