generateRandom done
This commit is contained in:
parent
91f6f870de
commit
c5e5feecca
|
|
@ -1,5 +1,6 @@
|
||||||
package backend;
|
package backend;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
||||||
import windowInterface.MyInterface;
|
import windowInterface.MyInterface;
|
||||||
|
|
@ -309,6 +310,12 @@ public class Simulator extends Thread {
|
||||||
* maybe just make a constructor in there
|
* maybe just make a constructor in there
|
||||||
* and use it here
|
* 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() {
|
public boolean isLoopingBorder() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue