function getRandomIntInclusive(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1) + min);
}
function shuffleOliver(array) {
let current;
let top;
let tmp = (current = top = array?.length);
if (!top) {
return array;
}
while (--top) {
current = getRandomIntInclusive(0, top);
tmp = array[current];
array[current] = array[top];
array[top] = tmp;
}
return array;
};
function shuffleAndrea(array) {
let {length} = array;
while (length--) {
let i = getRandomIntInclusive(0, length);
[array[i], array[length]] = [array[length], array[i]];
}
return array;
};
function shuffleNikolay(array) {
const t = array.splice(0, array.length);
while (t.length > 0) {
const index = getRandomIntInclusive(0, t.length - 1);
array.push(t.splice(index, 1)[0]);
}
return array;
};
window.array_10000 = Array.from(Array(10000).keys());