Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class Foo {
  2.     public static void main(String args[]) {
  3.         int counter = 0;
  4.         while(true) {
  5.             counter++;
  6.             if (counter % 5 == 0) {
  7.                 if (Math.random(4)+1 == 1) {
  8.                     System.out.println("Found it after " + counter + " minutes");
  9.                     break;
  10.                 }
  11.             }
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement