Last active
September 22, 2017 14:01
-
-
Save schas002/fb2421a0158c199c99c79cd5df673a75 to your computer and use it in GitHub Desktop.
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
const Chance = require('chance'); | |
const argv = require('yargs').argv; | |
const chalk = require('chalk'); | |
let seed; | |
if(typeof argv.seed === 'undefined') { | |
seed = Math.floor(Math.random() * Math.pow(2, 32)); | |
} else { | |
seed = argv.seed; | |
} | |
let rn = new Chance(seed); | |
console.log(chalk`{yellow Prompt generated ${new Date().toISOString()}}`); | |
console.log(chalk`{cyan Verifiable seed: ${seed}}`); | |
let categories = argv.c; | |
console.log(chalk`Pick from ${categories.length} categories: {bold ${rn.pickone(categories)}}`); | |
let min = argv.a; let max = argv.b; | |
console.log(chalk`Pick between ${min} and ${max}: {bold ${rn.integer({min, max})}}`); | |
console.log(chalk`{cyan mkprompt from https://gist.github.com/schas002/fb2421a0158c199c99c79cd5df673a75}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment