Skip to content

Instantly share code, notes, and snippets.

@andrewdanks
Last active May 7, 2022 18:08
Show Gist options
  • Save andrewdanks/4099093 to your computer and use it in GitHub Desktop.
Save andrewdanks/4099093 to your computer and use it in GitHub Desktop.
"Cool story, bro" alternatives
from itertools import product
from random import choice
# Cool story, bro. alternatives
# by @andrewdanks
# Prints all combinations iff True; prints a random sentence otherwise.
print_all_combos = False
story_adjectives = ['intriguing', 'riveting', 'gripping', 'fascinating', 'compelling', 'charming', 'dazzling']
story_nouns = ['adventure', 'story', 'tale', 'anecdote', 'saga', 'fable', 'parable', 'exemplum', 'discourse']
person_nouns = ['chap', 'lad', 'fella', 'sir', 'brethren', 'comrade', 'mate', 'chum']
format_sentence = lambda adj, noun, pronoun: '%s %s, %s.' % (adj.capitalize(), noun, pronoun)
if print_all_combos:
combos = product(story_adjectives, story_nouns, person_nouns)
for sentence in combos:
print format_sentence(sentence[0], sentence[1], sentence[2])
else:
print format_sentence(choice(story_adjectives), choice(story_nouns), choice(person_nouns))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment