Coordinate Array?..
in
Programming Questions
•
2 years ago
I've been using processing for about 2 weeks so i'm quite new to it. I've created a "for" loop that fills the background with 20x20 squares. Now i want to add white squares on top of it all to write words with the pixels.. I've got a list of all the Xs and Ys I want my 20X20 squares to be placed..
..that's what I've been doing but I'm pretty sure there's a more affective way..
- int x=20;
- int y=20;
- void draw(){
- fill(random(230,255));
- rect(3*x,2*y,20,20);
- rect(4*x,2*y,20,20);
- rect(8*x,2*y,20,20);
- rect(9*x,2*y,20,20);
- rect(12*x,2*y,20,20);
- rect(13*x,2*y,20,20);
- rect(14*x,2*y,20,20);
- rect(17*x,2*y,20,20);
- rect(18*x,2*y,20,20);
- rect(21*x,2*y,20,20);
- rect(25*x,2*y,20,20);
1