20 lines
395 B
Java
20 lines
395 B
Java
|
package fr.pandacube.java.util;
|
||
|
|
||
|
import java.util.Random;
|
||
|
|
||
|
public class RandomUtil {
|
||
|
|
||
|
public static Random rand = new Random();
|
||
|
|
||
|
|
||
|
public static int nextIntBetween(int minInclu, int maxExclu) {
|
||
|
return rand.nextInt(maxExclu-minInclu)+minInclu;
|
||
|
}
|
||
|
|
||
|
|
||
|
public static double nextDoubleBetween(double minInclu, double maxExclu) {
|
||
|
return rand.nextDouble()*(maxExclu-minInclu)+minInclu;
|
||
|
}
|
||
|
|
||
|
}
|