Simple "for" loop question

edited December 2015 in Questions about Code

Relatively new to Processing. Can't figure out why the code below doesn't work. It DOES work if I remove the "void setup();" command before and after size. I gather it messes with the "for" loop, but don't understand why. Thanks.

void setup(); { size(200,200); } // With a for loops for (int x = 0; x < width; x+=10) { for (int y = 0; y < height; y+=10) { noStroke(); fill(random(255)); rect(x,y,10,10); } }

Tagged:

Answers

Sign In or Register to comment.