Just checking that this shuffling algorithm is suitable. Or maybe there could be improvements?
public static void shuffleArray(Object[] arr, Random rnd){
int lastIndex = arr.length - 1;
for (int i=0; i<=lastIndex; i++){
int k = nextInt(i,lastIndex+1, rnd);
Object a = arr[i];
Object b = arr[k];
arr[i] = b;
arr[k] = a;
}
}
//Returns an integer between start(inclusive) and end(exclusive) [start..end)
public static int nextInt ( int start, int end, Random rnd);
Collections.shuffle()
, any reason why you don't use that? \$\endgroup\$byte
(s). And I believe it will be tedious todo type conversions, etc. \$\endgroup\$