Skip to content

Instantly share code, notes, and snippets.

@Mottokrosh
Last active August 28, 2015 10:50
Show Gist options
  • Save Mottokrosh/aa5301ef4a359bb90678 to your computer and use it in GitHub Desktop.
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
#!/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