Skip to content

Instantly share code, notes, and snippets.

@todoubled
Created November 23, 2011 22:23
Show Gist options
  • Save todoubled/1390104 to your computer and use it in GitHub Desktop.
Save todoubled/1390104 to your computer and use it in GitHub Desktop.
Randomize the order of strings in an array
array = [
"dog"
"cat"
"fish"
]
randomize = -> return (Math.round(Math.random())-0.5)
random = array.sort randomize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment