This commit is contained in:
Luca Jäntsch
2019-05-29 17:06:29 +02:00
parent c4c36b2787
commit fa6f0f88e0
8 changed files with 125 additions and 18 deletions

18
test/random.js Normal file
View File

@@ -0,0 +1,18 @@
var users = 10;
var needed = 5;
var already_picked = [];
for(var i = 0;i<needed;i++){
var pushed = false;
do {
var x = Math.floor(Math.random()*users);
if(already_picked.indexOf(x)===-1){
already_picked.push(x);
console.log(x);
pushed = true;
}
} while (pushed == false);
}