Skip to content

Instantly share code, notes, and snippets.

@esthernam1
Created October 17, 2018 01:07
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 esthernam1/632aac1cff48e9b8bbe41d493da21073 to your computer and use it in GitHub Desktop.
Save esthernam1/632aac1cff48e9b8bbe41d493da21073 to your computer and use it in GitHub Desktop.
String arrayOne [] = { "SQUARE", "RECTANGLE", "CUBE", "QUADRILATERAL", "FOUR-SIDED THING" };
void setup() {
background(255);
size(500, 300);
//rectMode (CENTER);
float r = random(0, 1); //probability
//console will spit out 1 of 5 names
for (int i=0; i<1; i+=r) {
if (r>0 && r<0.2) {
i=0;
}
if (r>0.2 && r<0.4) {
i=1;
}
if (r>0.4 && r<0.6) {
i=2;
}
if (r>0.6 && r<0.8) {
i=3;
}
if (r>0.8 && r<1) {
i=4;
}
println (arrayOne[i]);
}
}
void draw() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment