Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public class Bingo{
  2. public static Random r = new Random();
  3.  
  4. public static int getRandomNumber(int min, int max){
  5. int randomNum = java.util.concurrent.ThreadLocalRandom.current().nextInt(min, max);
  6. return randomNum;
  7. }
  8.  
  9. public static void main (String args[]) throws Exception{
  10.  
  11. for ( int i = 0 ; i < 10 ; i = i+0 ){
  12. int num = r.nextInt(100);
  13. writeLine(num);
  14.  
  15. boolean hit = false;
  16. int c = 0;
  17.  
  18. while (r.nextInt(5) != 1 && c < 1000) {
  19. c++;
  20. }
  21.  
  22. if (c < 1000) {
  23. hit = true;
  24. }
  25.  
  26. Thread.sleep(100);
  27. }
  28. }
  29.  
  30. public static void writeLine(String s){
  31. System.out.println(s);
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement