Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package main;
  2.  
  3. import java.util.Random;
  4.  
  5. public class RandomHelper {
  6.  
  7.     public static boolean getBigChance(){
  8.         Random random = new Random();
  9.         boolean value = (random.nextDouble()<0.9);
  10.         return value;
  11.     }
  12.  
  13.     public static boolean get50Chance(){
  14.         Random random = new Random();
  15.         boolean value = (random.nextDouble()<0.5);
  16.         return value;
  17.     }
  18.  
  19.     public static int getInt(int lower, int upper){
  20.         Random random = new Random();
  21.         int value = lower + random.nextInt(upper);
  22.         return value;
  23.  
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement