Need help - JS

so I tried to create a JS program and it said " A while loop is taking too long to run. Perhaps you have a mistake in your code? here is the code

draw = function() {
    var r = random(0,255);
    background(255, 255, 255);
    fill(r,r,r);
var y = 0;
var x = 0;
while (y < 400) {
    rect(0,y,10,10);
    y += 10;
    while(x < 400){
      rect(x,0,10,10);  
        }
    }
};

Do you see a way that the value of x will increase?

2 Likes

oh ■■■■, I forgot that