Nested loops?
in
Programming Questions
•
6 months ago
I'm trying to draw a checkerboard that alternates black and white.
I have to use loops, so this is what I have so far:
- for(int i=200; i>100; i= i-10){
- rect(5, i, 10, 10);
- }
1. How do I change the Y value after each row is completed, so it creates multiple rows. (I'm guessing with nested loops, but I don't know how to use them.)
2. How can I alternate black and white squares in the rows?
Thanks for your help.
1