Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. public static double getRandDouble(double min, double max) throws IllegalArgumentException{
  2. Validate.isTrue(max > min, "Max can't be smaller than min!");
  3. return RAND.nextDouble() * (max - min) + min;
  4. }
  5.  
  6. public static boolean getChance(double chance){
  7. return (chance >= 100) || (chance >= getRandDouble(0, 100));
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement