Created
May 5, 2016 14:31
-
-
Save cnaude/476b30240b80b7be8511a4ea7d4f09e8 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
public static void main(String[] args) { | |
randomGenerator = new Random(); | |
int c = 4; | |
int count = 0; | |
for (int x = 0; x <= 30; x++) { | |
int r = randomGenerator.nextInt(100); | |
if (r >= c) { | |
System.out.println("Drop: " + r); | |
} else { | |
count++; | |
System.out.println("Keep: " + r); | |
} | |
} | |
System.out.println("Kept " + count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment