Ajout Grille + Swing UI Grille Sudoku
This commit is contained in:
30
Grid.java
Normal file
30
Grid.java
Normal 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];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user