Guest User

Untitled

a guest
Oct 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. String arrayOne [] = { "SQUARE", "RECTANGLE", "CUBE", "QUADRILATERAL", "FOUR-SIDED THING" };
  2.  
  3.  
  4. void setup() {
  5. background(255);
  6. size(500, 300);
  7. //rectMode (CENTER);
  8.  
  9. float r = random(0, 1); //probability
  10. //console will spit out 1 of 5 names
  11. for (int i=0; i<1; i+=r) {
  12. if (r>0 && r<0.2) {
  13. i=0;
  14. }
  15. if (r>0.2 && r<0.4) {
  16. i=1;
  17. }
  18. if (r>0.4 && r<0.6) {
  19. i=2;
  20. }
  21. if (r>0.6 && r<0.8) {
  22. i=3;
  23. }
  24. if (r>0.8 && r<1) {
  25. i=4;
  26. }
  27. println (arrayOne[i]);
  28. }
  29. }
  30. void draw() {
  31. }
Add Comment
Please, Sign In to add comment