Skip to content

Instantly share code, notes, and snippets.

@saturnflyer
Created October 29, 2009 21:17
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 saturnflyer/221850 to your computer and use it in GitHub Desktop.
Save saturnflyer/221850 to your computer and use it in GitHub Desktop.
// Fisher-Yates shuffle
function fyshuffle(a){ var t,i,l = a.length; if(l) while(--l){ i = Math.floor(Math.random() * (l + 1)); t = a[i]; a[i] = a[l]; a[l] = t; }; return a;};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment