Last active
August 29, 2015 14:19
-
-
Save joshblack/0e1f4366bda7bde91db9 to your computer and use it in GitHub Desktop.
Write a function that returns a list of size n, containing random, distinct numbers using the functions given below.
This file contains hidden or 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
/** | |
* Write a function that returns a list of size n, | |
* containing random, distinct numbers using the | |
* function given below. | |
*/ | |
/** | |
* Generates a random number from 1 -> [ceil] | |
* | |
* @param {Number} ceil | |
* @return {Number} | |
*/ | |
function random(ceil) { | |
return Math.floor(Math.random() * ceil) + 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment