Skip to content

Instantly share code, notes, and snippets.

@an-OK-squirrel
Created August 7, 2015 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save an-OK-squirrel/edee09362d83387d45d9 to your computer and use it in GitHub Desktop.
Save an-OK-squirrel/edee09362d83387d45d9 to your computer and use it in GitHub Desktop.
// Not Very Meaningful Statement
// also my first P3 program :P
// By an-OK-squirrel
void setup() {
size(500, 500);
noStroke();
fill(255, 255, 255, 10);
doAThing();
}
void drawObj(int x, int y, int r) {
boolean isCircle = random(1) > 0.5;
for (int i = 0; i < 4; i++) {
if (isCircle) {
rect(x - r, y - r, r * 2, r * 2 - i);
} else {
ellipse(x, y, r * 2, r * 2 - i);
}
}
}
void doAThing() {
background(60, 10, 80);
for (int x = 0; x < 10; x++) {
for (int y = 0; y < 10; y++) {
drawObj(x * 50 + 25, y * 50 + 25, 50);
}
}
}
void draw() {
// no clue why, but the below function only works with
// a draw function
// but I don't need one, so I wrote a nice little happy
// set of comments
}
void mouseClicked() {
doAThing();
}
@an-OK-squirrel
Copy link
Author

@PullJosh check dis out bro

@PullJosh
Copy link

PullJosh commented Aug 7, 2015

Woah, cool!

@an-OK-squirrel
Copy link
Author

Heh, thanks! it took a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment