31 lines
588 B
Java
Raw Normal View History

2024-04-28 01:40:14 +02:00
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];
}
}