Guest User

Untitled

a guest
May 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. function rollDice(){
  2. var output = [];
  3. var die1 = Math.floor(Math.random() * 6);
  4. var die2 = Math.floor(Math.random() * 6);
  5. // need to add 1 to avoid zero based output
  6. output.push(die1 + 1);
  7. output.push(die2 + 1);
  8. return output;
  9. }
Add Comment
Please, Sign In to add comment