Last active
August 29, 2015 14:10
-
-
Save amonks/08010d21033005deb8f7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| int[] numbers = new int[3]; | |
| numbers[0] = 90; // Assign value to first element in the array | |
| numbers[1] = 150; // Assign value to second element in the array | |
| numbers[2] = 30; // Assign value to third element in the array | |
| // Get a random element from an array | |
| int index = int(random(numbers.length)); // Same as int(random(3)) | |
| println(numbers[index]); // Prints one of the three words |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment