Skip to content

Instantly share code, notes, and snippets.

@edymerchk
Created August 1, 2013 20:56
Show Gist options
  • Save edymerchk/6135225 to your computer and use it in GitHub Desktop.
Save edymerchk/6135225 to your computer and use it in GitHub Desktop.
shuffle
shuffle = (o) ->
i = o.length
while i
j = Math.floor(Math.random() * i)
x = o[--i]
o[i] = o[j]
o[j] = x
o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment