Guest User

Untitled

a guest
Feb 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. var input = process.argv.slice(2);
  2. var output = '';
  3.  
  4. function rollDice() {
  5. return Math.floor(Math.random() * Math.floor(6));
  6. }
  7.  
  8. for (var i = 0; i < input[0]; i++){
  9. if (output != ''){
  10. output += ", ";
  11. }
  12. output += rollDice();
  13. }
  14.  
  15.  
  16. console.log("Rolled " + input[0] + " dice: " + output);
Add Comment
Please, Sign In to add comment