Last active
August 28, 2015 10:50
-
-
Save Mottokrosh/aa5301ef4a359bb90678 to your computer and use it in GitHub Desktop.
A Node utility to roll up random cyphers from the Numenera Technology Guide
This file contains 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
#!/usr/bin/env node | |
function getRandomIntInclusive(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
(function genCypher() { | |
var list = ['A', 'B', 'C', 'D', 'E']; | |
var max = process.argv[2] || 5; | |
console.log('=========================================================='); | |
console.log('Generating ' + max + ' random cyphers from the Technology Compendium'); | |
console.log('=========================================================='); | |
for (var i = 0; i < max; i++) { | |
console.log('Cypher List ' + list[getRandomIntInclusive(0, 4)] + ', number ' + getRandomIntInclusive(1, 100)); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment