Skip to content

Instantly share code, notes, and snippets.

@xvaldetaro
Created January 24, 2016 19:29
Show Gist options
  • Save xvaldetaro/c1b4c3c62b2607cc8363 to your computer and use it in GitHub Desktop.
Save xvaldetaro/c1b4c3c62b2607cc8363 to your computer and use it in GitHub Desktop.
pickSome(z) {
var bool = false;
var i = 0
while (bool == false) {
i++;
y = z[Math.floor(Math.random() * z.length)];
if (i > 500) {
z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
console.log("500 tries already. Allowing any skills.");
}
if (skLearn[y] != true) {
skLearn[y] = true;
bool = true;
return y;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment