Skip to content

Instantly share code, notes, and snippets.

@mackenco
Created October 25, 2015 02:06
Show Gist options
  • Save mackenco/1b5b3bd5771f3473d11e to your computer and use it in GitHub Desktop.
Save mackenco/1b5b3bd5771f3473d11e to your computer and use it in GitHub Desktop.
Write a function that simulates the rolling of a 9 sided die.
1. What are the inputs and outputs to the function? Write these as a comment at the top of your file.
2. What's the formula to get a random number between 1 and 9?
3. What's an appropriate name for your function?
4. Write the function in JavaScript. Call it a couple times to ensure it works correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment