Skip to content

Instantly share code, notes, and snippets.

@joshblack
Last active August 29, 2015 14:19
Show Gist options
  • Save joshblack/0e1f4366bda7bde91db9 to your computer and use it in GitHub Desktop.
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.
/**
* 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