Skip to content

Instantly share code, notes, and snippets.

@slashingweapon
Last active February 25, 2016 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slashingweapon/9785578525bf9c132984 to your computer and use it in GitHub Desktop.
Save slashingweapon/9785578525bf9c132984 to your computer and use it in GitHub Desktop.
Javascript Bits
// Fischer-Yates shuffle
function shuffle(array) {
var m = array.length, t, i;
while (m) {
i = Math.floor(Math.random() * m--);
t = array[m];
array[m] = array[i];
array[i] = t;
}
return array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment