Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x = 0;
- int y = 0;
- void setup(){
- size(500,500);
- }
- void draw(){
- for(int i =0; i < 10; i++){
- int r = (int)random(0,255);
- int g = (int)random(0,255);
- int b = (int)random(0,255);
- int result = i % 2;
- if(result==0){
- fill(r,g,b);
- rect(x,y,50,50);
- }else{
- fill(r,g,b);
- rect(x,y,50,50);
- x+=50;
- }
- if(x>500){
- x=0;
- y+=50;
- }
- }
- }
Add Comment
Please, Sign In to add comment