Advertisement
Guest User

Untitled

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