Why won't the rectangle change colors faster?
in
Programming Questions
•
5 months ago
Here is my code:
void setup() {
size(600, 600);
}
void draw() {
for (int i = 0; i < 1000; i++) {
background(255, 255, 255);
fill((int)(Math.random()*255), 50, 50);
rect(0, 0, width, height);
}
}
This code addresses an issue I have with a bigger project, but why does this program wait until the entire loop is done for it to change colors? The rectangle should change colors 1000 times everytime the entire for loop is done, but it only changes it once.
1