Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
* @author jlmd
*/
public class Utils {

/** Pseudo-random number generator instance. */
private static final Random rand = new Random();

/**
* Returns a pseudo-random number between min and max, inclusive
* @param min Minimum value
* @param max Maximum value. Must be greater than min
* @return float between min and max, inclusive
*/
public static float randFloat(float min, float max) {
Random rand = new Random();
return rand.nextFloat() * (max - min) + min;
}
}