2019-08-25 02:39:20 -04:00
|
|
|
"use strict";
|
|
|
|
export function shuffled(array) {
|
|
|
|
array = array.slice();
|
|
|
|
for (let i = array.length - 1; i > 0; i--) {
|
2019-11-20 18:57:38 +09:00
|
|
|
const j = Math.floor(Math.random() * (i + 1));
|
|
|
|
const tmp = array[i];
|
2019-08-25 02:39:20 -04:00
|
|
|
array[i] = array[j];
|
|
|
|
array[j] = tmp;
|
|
|
|
}
|
|
|
|
return array;
|
|
|
|
}
|
2020-07-13 08:03:56 -04:00
|
|
|
//# sourceMappingURL=shuffle.js.map
|