Skip to content

Instantly share code, notes, and snippets.

@mathurakshay
Created April 28, 2013 04:30
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 mathurakshay/5475884 to your computer and use it in GitHub Desktop.
Save mathurakshay/5475884 to your computer and use it in GitHub Desktop.
returns a shuffeled list of numbers from 1 to the given number
###
# returns a shuffeled list of numbers from 1 to the given number
###
get_random_list = (t) ->
r_list = []
while r_list.length < t
n = Math.round(Math.random() * 100)
r_list.push n if n not in r_list and n in [1..t]
return r_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment