Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Gauge Smithee
- Dots using a while loop and the random function
- */
- size(500,500);
- int dotCount = 1;
- int dotColor;
- int xCoord = int(random(0,width));
- int yCoord = int(random(0,height));
- noStroke();
- while (dotCount <= 101) {
- dotColor = int(random(1,4));
- if (dotColor == 1) {
- fill(0,0,255);
- }else if (dotColor == 2) {
- fill(0,255,0);
- }else{
- fill(255,0,0);
- }
- ellipse(xCoord,yCoord,30,30);
- xCoord = int(random(0,width));
- yCoord = int(random(0,height));
- dotCount++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement