diff --git a/src/backend/Grid.java b/src/backend/Grid.java index 1393270..99bf246 100644 --- a/src/backend/Grid.java +++ b/src/backend/Grid.java @@ -1,10 +1,11 @@ package backend; +import java.util.Random; public class Grid { private int width; private int height; private int[][] grid; - + private int rando; public Grid(int width, int height) { this.width = width; this.height = height; @@ -26,4 +27,15 @@ public class Grid { throw new IndexOutOfBoundsException("Grid position out of range"); } } + + public void fillRandom(float randomness) { + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + int rando = Random.nextInt(100); + int r= (int) randomness*100; + if(rando