Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var input = process.argv.slice(2);
- var output = '';
- function rollDice() {
- return Math.floor(Math.random() * Math.floor(6));
- }
- for (var i = 0; i < input[0]; i++){
- if (output != ''){
- output += ", ";
- }
- output += rollDice();
- }
- console.log("Rolled " + input[0] + " dice: " + output);
Add Comment
Please, Sign In to add comment