This commit is contained in:
Timéo 2024-05-27 12:59:47 +02:00
commit a3e8ab56dd
1 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package backend;
import java.util.ArrayList;
import java.util.Random;
import windowInterface.MyInterface;
@ -309,6 +310,12 @@ public class Simulator extends Thread {
* maybe just make a constructor in there
* and use it here
*/
Random rand = new Random();
for (int x = 0; x < COL_NUM; x++) {
for (int y = 0; y < LINE_NUM; y++) {
world[x][y] = rand.nextFloat() < chanceOfLife ? 1 : 0;
}
}
}
public boolean isLoopingBorder() {