Advertisement
Gauge1417

Untitled

Oct 16th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. /* Gauge Smithee
  2. Dots using a while loop and the random function
  3. */
  4.  
  5. size(500,500);
  6. int dotCount = 1;
  7. int dotColor;
  8. int xCoord = int(random(0,width));
  9. int yCoord = int(random(0,height));
  10. noStroke();
  11.  
  12. while (dotCount <= 101) {
  13. dotColor = int(random(1,4));
  14. if (dotColor == 1) {
  15. fill(0,0,255);
  16. }else if (dotColor == 2) {
  17. fill(0,255,0);
  18. }else{
  19. fill(255,0,0);
  20. }
  21. ellipse(xCoord,yCoord,30,30);
  22. xCoord = int(random(0,width));
  23. yCoord = int(random(0,height));
  24. dotCount++;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement