From 5e45df9159267c3f3f630d6e89bb20ebd690a6aa Mon Sep 17 00:00:00 2001 From: sebas Date: Thu, 23 May 2024 11:34:25 +0200 Subject: [PATCH] ahhhaha --- src/backend/Grid.java | 14 +++++++++++++- src/backend/Simulator.java | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) 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