Skip to content

Instantly share code, notes, and snippets.

Created February 27, 2018 11:02
Show Gist options
  • Save anonymous/5e770293912f38551f97f1ec1dc51280 to your computer and use it in GitHub Desktop.
Save anonymous/5e770293912f38551f97f1ec1dc51280 to your computer and use it in GitHub Desktop.
Output a list of random task titles
// usage: node random-task.js [numPhrasesToGenerate]
const words = [
['accept', 'acceptance', 'acceptable', ''],
['achieve', 'achievements', 'achievable', ''],
['act', 'actions', 'active', 'actively'],
['act', 'activities', 'active', 'actively'],
['act', 'activeness', 'active', 'actively'],
['add', 'additions', 'additional', ''],
['adjust', 'adjustments', 'adjustable', ''],
['admire', 'admiration', 'admirable', ''],
['advise', 'advice', 'advisable', ''],
['amass', 'masses', 'massive', 'massively'],
['amazed', 'amazement', 'amazing', ''],
['amuse', 'amusement', 'amusing', ''],
['annoy', 'annoyances', 'annoying', ''],
['approach', 'approaches', 'approachable', ''],
['attend', 'attention', 'attentive', ''],
['attract', 'attraction', 'attractive', ''],
['avoid', 'avoidance', 'avoidable', ''],
['believe', 'beliefs', 'believable', ''],
['blacken', 'blackness', 'black', ''],
['bleed', 'blood', 'bloody', ''],
['bore', 'boredom', 'boring', ''],
['bother', 'botheration', 'bothering', ''],
['breathe', 'breaths', 'breathing', ''],
['bury', 'burials', 'buried', ''],
['care', 'care', 'careful', 'carefully'],
['challenge', 'challenges', 'challenging', ''],
['chase', 'chase', 'chasing', ''],
['cheer', 'cheerfulness', 'cheerful', 'cheerfully'],
['choose', 'choices', 'chosen', ''],
['clear', 'clarity', 'clear', 'clearly'],
['collect', 'collections', 'collective', 'collectively'],
['comfort', 'comforts', 'comfortable', 'comfortably'],
['complex', 'complexities', 'complex', ''],
['confuse', 'confusion', 'confused', ''],
['consider', 'considerations', 'considerable', 'considerably'],
['console', 'consolations', 'consoled', ''],
['continue', 'continuities', 'continuous', 'continuously'],
['craze', 'crazes', 'crazy', 'crazily'],
['create', 'creations', 'creative', 'creatively'],
['credit', 'credits', 'creditable', 'creditably'],
['cure', 'cures', 'curable', ''],
['curse', 'curses', 'cursed', ''],
['damage', 'damages', 'damaged', ''],
['deafen', 'deafness', 'deaf', ''],
['decide', 'decisions', 'decisive', ''],
['decorate', 'decorations', 'decorative', ''],
['delight', 'delights', 'delightful', 'delightfully'],
['demand', 'demands', 'demanding', ''],
['derive', 'derivations', 'derivative', ''],
['deserve', 'deserve', 'deserving', ''],
['destroy', 'destructions', 'destructive', 'destructively'],
['develop', 'developments', 'developing', ''],
['die', 'deaths', 'dead', ''],
['differ', 'differences', 'different', 'differently'],
['disturb', 'disturbances', 'disturbing', ''],
['dust', 'dust', 'dusty', ''],
['educate', 'education', 'educative', ''],
['embarrass', 'embarrassments', 'embarrassing', ''],
['empower', 'powers', 'powerful', 'powerfully'],
['empty', 'emptiness', 'empty', ''],
['encircle', 'circles', 'circular', 'circularly'],
['encourage', 'courage', 'courageous', 'courageously'],
['endanger', 'dangers', 'dangerous', 'dangerously'],
['enthuse', 'enthusiasm', 'enthusiastic', ''],
['enumerate', 'numbers', 'numerable', ''],
['envy', 'envies', 'envious', 'enviously'],
['evaporate', 'evaporation', 'evaporating', ''],
['expect', 'expectations', 'expected', 'expectedly'],
['explain', 'explanations', 'explainable', ''],
['explore', 'explorations', 'exploring', ''],
['fascinate', 'fascinations', 'fascinating', ''],
['feed', 'food', '', ''],
['firm', 'firmness', 'firm', 'firmly'],
['fly', 'flights', 'flying', ''],
['force', 'forces', 'forceful', 'forcefully'],
['glorify', 'glories', 'glorious', 'gloriously'],
['grow', 'growths', 'growing', 'growingly'],
['harm', 'harms', 'harmful', 'harmfully'],
['hate', 'hatred', 'hateful', 'hatefully'],
['heal', 'health', 'healthy', 'healthily'],
['hope', 'hopes', 'hopeful', 'hopefully'],
['identify', 'identification', 'indentified', ''],
['identify', 'identities', 'indentifying', ''],
['imitate', 'imitations', 'imitative', 'imitatively'],
['impress', 'impressions', 'impressive', 'impressively'],
['include', 'inclusions', 'inclusive', 'inclusively'],
['indicate', 'indications', 'indicative', 'indicatively'],
['inform', 'information', 'informative', ''],
['inhabit', 'habitats', 'inhabitant', ''],
['injure', 'injuries', 'injurious', 'injuriously'],
['inquire', 'inquiries', 'inquiring', ''],
['instruct', 'instructions', 'instructive', ''],
['insult', 'insults', 'insulting', 'insultingly'],
['intent', 'intentions', 'intentional', 'intentionally'],
['interfere', 'interferences', 'interfering', ''],
['introduce', 'introductions', 'introductory', ''],
['invent', 'inventions', 'inventive', ''],
['irritate', 'irritations', 'irritating', 'irritatingly'],
['lead', 'leadership', 'leading', 'leadingly'],
['live', 'lives', 'lively', 'livingly'],
['live', 'lives', 'alive', 'livingly'],
['live', 'liveliness', 'lively', 'livingly'],
['lose', 'losses', 'lost', ''],
['madden', 'madness', 'mad', 'madly'],
['migrate', 'migrations', 'migrating', ''],
['modernise', 'modernities', 'modern', ''],
['moisten', 'moisture', 'moistures', ''],
['monotonies', 'monotony', 'monotonous', 'monotonously'],
['move', 'movements', 'movable', 'movingly'],
['narrow', 'narrowness', 'narrow', ''],
['nationalise', 'nationalities', 'national', 'nationwide'],
['observe', 'observations', 'observatory', ''],
['own', 'ownership', 'own', ''],
['perform', 'performances', 'performing', ''],
['permit', 'permissions', 'permissible', ''],
['persuade', 'persuasions', 'persuasive', ''],
['please', 'pleasures', 'pleasant', ''],
['popularise', 'popularity', 'popular', ''],
['quicken', 'quickness', 'quick', 'quickly'],
['redden', 'redness', 'red', ''],
['sadden', 'sadness', 'sad', 'sadly'],
['secure', 'securities', 'secured', 'securely'],
['see', 'scenes', 'scenic', ''],
['see', 'sights', 'seen', ''],
['speed', 'speeds', 'speedy', 'speedily'],
['whiten', 'whiteness', 'white', ''],
['', 'badness', 'bad', 'badly'],
];
const verbs = words.map(([verb]) => verb).filter(Boolean);
const nouns = words.map(([,noun]) => noun).filter(Boolean);
const adjectives = words.map(([,,adj]) => adj).filter(Boolean);
const adverbs = words.map(([,,,adv]) => adv).filter(Boolean);
function pickRandom(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}
function capitalize(str) {
return str[0].toUpperCase() + str.slice(1);
}
const count = parseInt(process.argv[2], 10) || 5;
const output = (new Array(count)).fill('').map(() =>
[adverbs, verbs, adjectives, nouns].map(pickRandom).join(' ')
).map(capitalize).sort().join('\n');
console.log(output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment