List of utility methods to do Random Int
String | random(int length, String data) random String str = ""; int len = data.length(); while (length > 0) { length--; str += data.charAt((int) (Math.random() * len)); return str; |
int | random(int limit) random return ((limit < 1) ? -1 : (int) ((Math.random() * 100000) % (limit)) + 1); |
int | random(int lo, int hi) Answer a (pseudo-)random integer lo <= x < hi Creation date: (08.10.2002 20:34:42) int len = hi - lo; int x = (int) (Math.random() * len); return lo + x; |
int | Random(int low, int high) Random return low + (int) (((double) high - (double) low) * Math.random()); |
int | random(int lowerBound, int upperBound) random return (lowerBound + (int) Math.round(Math.random() * (upperBound - lowerBound))); |
int | random(int maxValue) random return (int) (Math.random() * (maxValue + 1)); |
int | random(int min, int max) random return (int) (Math.random() * max + min); |
int | random(int min, int max) random return (int) Math.round(random((double) min, max)); |
int | random(int min, int max) random return (int) (min + (Math.random() * max)); |
int | random(int min, int max) random return (int) (min + Math.random() * (max - min)); |