Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Foo {
- public static void main(String args[]) {
- int counter = 0;
- while(true) {
- counter++;
- if (counter % 5 == 0) {
- if (Math.random(4)+1 == 1) {
- System.out.println("Found it after " + counter + " minutes");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement