Created
October 17, 2018 01:07
-
-
Save esthernam1/632aac1cff48e9b8bbe41d493da21073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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