Last active
August 29, 2015 14:24
-
-
Save molarmanful/9e711a375d2c642bed0c to your computer and use it in GitHub Desktop.
Javascript-golfed Fisher-Yates Shuffle algorithms, dependent only on the Math.random function (basically, it's cross-browser). Each function takes an array as input and outputs scrambled array.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(a){for(b=a.length;b;a[b]=[a[c],a[c]=a[b]][0])c=0|Math.random()*b--;return a} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment