First Commit

This commit is contained in:
MatMasIt
2021-10-09 16:57:51 +02:00
committed by GitHub
parent 2d2f44cd3b
commit 9e51501b94
21 changed files with 463 additions and 0 deletions

17
js/util.js Normal file
View File

@@ -0,0 +1,17 @@
function shuffle(array) {
let currentIndex = array.length, randomIndex;
// While there remain elements to shuffle...
while (currentIndex != 0) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
// And swap it with the current element.
[array[currentIndex], array[randomIndex]] = [
array[randomIndex], array[currentIndex]];
}
return array;
}