added time optimizations

This commit is contained in:
Ninja-Jambon 2024-03-03 19:09:36 +01:00
parent e4742d8a14
commit 8839c351b9
3 changed files with 29 additions and 2 deletions

View file

@ -133,6 +133,16 @@ public class Universe {
this.grid = newgrid;
this.width = width;
this.height = height;
this.boxes_to_fill = 0;
for (int i = 1; i < height - 1; i++) {
for (int j = 1; j < width - 1; j++) {
if (this.grid[i][j] == 0) {
this.boxes_to_fill ++;
}
}
}
}
public void changeUniverseStart(int pos_i, int pos_j, int dir) {