go6eto

Untitled

Mar 4th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int x = 0;
  2. int y = 0;
  3.  
  4. void setup(){
  5. size(500,500);
  6. }
  7.  
  8. void draw(){
  9.  
  10. for(int i =0; i < 10; i++){
  11. int r = (int)random(0,255);
  12. int g = (int)random(0,255);
  13. int b = (int)random(0,255);
  14. int result = i % 2;
  15.  
  16. if(result==0){
  17. fill(r,g,b);
  18. rect(x,y,50,50);
  19.  
  20. }else{
  21. fill(r,g,b);
  22. rect(x,y,50,50);
  23. x+=50;
  24. }
  25. if(x>500){
  26. x=0;
  27. y+=50;
  28. }
  29.  
  30. }
  31. }
Add Comment
Please, Sign In to add comment