Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x = 0;
- int y = 0;
- void setup() {
- size(500,500);
- background(#1437F5);
- fill(#F51414);
- }
- void draw() {
- for (int i = 0; i < 10; i++) {
- if (i % 2 == 0) {
- if (y == 0|| y == 100 || y == 200 || y == 300 || y == 400 || y == 500) {
- fill(#F51414);
- rect(x,y, 50, 50);
- }
- x += 50;
- if (x >= 500) {
- x = 0;
- y += 50;
- }
- } else if (i % 2 == 1) {
- if (y == 50 || y == 150 || y == 250 || y == 350|| y == 450) {
- fill(#F51414);
- rect(x,y, 50, 50);
- }
- x += 50;
- if (x >= 500) {
- x = 0;
- y += 50;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment