bug resolution
This commit is contained in:
parent
42746ad5b0
commit
bb09c5afca
6 changed files with 22 additions and 4 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue