Tenanea generator prototype
This commit is contained in:
parent
8aa8d1463a
commit
1a4eaa7c6e
6 changed files with 156 additions and 0 deletions
|
@ -124,4 +124,13 @@ public class MHelper {
|
|||
h = (h ^ (h >> 13)) * 1274126177;
|
||||
return h ^ (h >> 16);
|
||||
}
|
||||
|
||||
public static <T> void shuffle(T[] array, Random random) {
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
int i2 = random.nextInt(array.length);
|
||||
T element = array[i];
|
||||
array[i] = array[i2];
|
||||
array[i2] = element;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue