List of utility methods to do Array Randomize
List | randomList(List random List int min = 1; int max = options.size(); List<String> list = new ArrayList<String>(options); String temp2 = list.get(max - 1); list.remove(max - 1); list.add(1, temp2); Random r = new Random(); for (int i = 0; i < max; i++) { ... |
T | getRandom(T... any) Gets random value get param any
return any[(int) (Math.random() * any.length)]; |