Created
November 13, 2016 17:28
-
-
Save RcrdBrt/a0b3e8680eb31f1763e17cbb88ae13a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colors = require('colors/safe'); | |
// 6-sided dice | |
var min = 1, | |
max = 6, | |
first = roll(min, max), | |
second = roll(min, max); | |
console.log("Dice 1:", first); | |
console.log("Dice 2:", second); | |
console.log(colors.cyan(colors.bold("Tot: " + (first + second)))); | |
function roll(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment