bug resolution

This commit is contained in:
Lukian LEIZOUR 2024-03-28 23:33:35 +01:00
parent 42746ad5b0
commit bb09c5afca
6 changed files with 22 additions and 4 deletions

View file

@ -403,7 +403,15 @@ public class Universe {
}
public int[][] copyGrid() {
return this.grid.clone();
int [][] newGrid = new int[this.height][this.width];
for (int i = 0; i < this.height; i++) {
for (int j = 0; j < this.width; j++) {
newGrid[i][j] = this.grid[i][j];
}
}
return newGrid;
}
public int getWidth() {