Created
April 28, 2013 04:30
-
-
Save mathurakshay/5475884 to your computer and use it in GitHub Desktop.
returns a shuffeled list of numbers from 1 to the given number
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
### | |
# 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