Skip to content

Instantly share code, notes, and snippets.

@colinvh
Created May 21, 2018 18:50
Show Gist options
  • Save colinvh/817500bdc84b1c4ce4fa3fc5bfbe9381 to your computer and use it in GitHub Desktop.
Save colinvh/817500bdc84b1c4ce4fa3fc5bfbe9381 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import random
def descriptor(described):
d = random.choice(DESCRIPTORS)
if d[-1] == '-':
if lower(described[0]) in 'aeiou':
return d[:-2] + described
else:
return d[:-1] + described
else:
return d + ' ' + described
def descriptor_ingredient():
if random.choice([True, False]):
described = random.choice(NOUNS)
else:
described = random.choice(ABSTRACTS)
return descriptor(described)
def being_ingredient():
if random.choice([True, False]):
described = ' ' + random.choice(NOUNS)
else:
described = "'s " + random.choice(ABSTRACTS)
return random.choice(BEINGS) + described
def abstract_ingredient():
return random.choice(ABSTRACTS) + ' ' + random.choice(NOUNS)
def piece_ingredient():
return random.choice(PICES) + ' of ' + random.choice(CONCEPTS)
INGREDIENTS = [
[10, descriptor_ingredient],
[6, being_ingredient],
[3, abstract_ingredient],
[1, piece_ingredient],
]
def all_ingredients():
for i, fn in INGREDIENTS:
for _ in xrange(i):
yield fn
ALL_INGREDIENTS = list(all_ingredients())
def ingredient():
return random.choice(ALL_INGREDIENTS)()
COLORS = ['Amber', 'Aqua', 'Auburn', 'Azure', 'Beige', 'Black', 'Blond', 'Blue', 'Brown', 'Bone', 'Burgundy', 'Celadon', 'Coral', 'Crimson', 'Gray', 'Green', 'Indigo', 'Ivory', 'Lilac', 'Magenta', 'Maroon', 'Orange', 'Pink', 'Purple', 'Red', 'Rust', 'Sanguine', 'Scarlet', 'Snow', 'Spotted', 'Striped', 'Tan', 'Teal', 'Verdigris', 'Vermilion', 'Viridian', 'Violet', 'White', 'Yellow']
FLAVORS = ['Bitter', 'Bittersweet', 'Metallic', 'Pungent', 'Salty', 'Savory', 'Sweet']
STONES = ['Amethyst', 'Aquamarine', 'Beryl', 'Carnelian', 'Citrine', 'Crystal', 'Diamond', 'Emerald', 'Garnet', 'Glass', 'Granite', 'Jade', 'Malachite', 'Opal', 'Pearl', 'Ruby', 'Sapphire', 'Spinel', 'Stone', 'Topaz']
METALS = ['Brass', 'Bronze', 'Cobalt', 'Copper', 'Gold', 'Iron', 'Lead', 'Mercury', 'Silver', 'Steel', 'Tin']
SHAPES = ['Bi-', 'Circle', 'Crescent', 'Curved', 'Deca-', 'Ellipse', 'Eight', 'Five', 'Four', 'Kite', 'Hexa-', 'Octa-', 'One', 'Nine', 'Nona-', 'Oval', 'Penta-', 'Pentacle', 'Pointed', 'Quadra-', 'Round', 'Seven', 'Septa-', 'Sharp', 'Six', 'Square', 'Star', 'Sun', 'Ten', 'Three', 'Tri-', 'Two', 'Una-']
ADJECTIVES = ['Blind', 'Clever', 'Dear', 'Deranged', 'Fearless', 'Foul', 'Godly', 'Large', 'Learned', 'Mellow', 'Melted', 'Midnight', 'Miniature', 'Placid', 'Small', 'Thin', 'Tranquil', 'Wild']
DESCRIPTORS = COLORS + FLAVORS + STONES + METALS + SHAPES + ADJECTIVES
CONCEPTS = ['Aggression', 'Agony', 'Anger', 'Atrophy', 'Benevolence', 'Charity', 'Chastity', 'Compassion', 'Courage', 'Cowardice', 'Cruelty', 'Death', 'Deception', 'Despair', 'Deterioration', 'Disgust', 'Dream', 'Duty', 'Fame', 'Fear', 'Forgiveness', 'Folly', 'Freedom', 'Fury', 'Glory', 'Greed', 'Happiness', 'Honesty', 'Honor', 'Immortality', 'Innocence', 'Jealousy', 'Justice', 'Knowledge', 'Insanity', 'Lament', 'Liberty', 'Life', 'Love', 'Loyalty', 'Lust', 'Madness', 'Misery', 'Mortality', 'Mirth', 'Pain', 'Pride', 'Prudence', 'Sadness', 'Surprise', 'Temptation', 'Terror', 'Vanity', 'Vengeance', 'Wisdom']
OBJECTS = ['Armor', 'Arrow', 'Axe', 'Ball', 'Bell', 'Boot', 'Bow', 'Breath', 'Buckle', 'Candle', 'Cask', 'Castle', 'Cauldron', 'Cloak', 'Cloud', 'Cowl', 'Crook', 'Crown', 'Cup', 'Dagger', 'Dart', 'Dream', 'Drum', 'Fiddle', 'Fife', 'Flail', 'Flute', 'Fountain', 'Glove', 'Hammer', 'Harp', 'Hat', 'Heart', 'Hood', 'Hook', 'Horn', 'Key', 'Kiss', 'Knife', 'Lamp', 'Lance', 'Lantern', 'Lightning', 'Lute', 'Lyre', 'Mace', 'Mandolin', 'Mantle', 'Mask', 'Moon', 'Needle', 'Pike', 'Pipe', 'Quill', 'Quiver', 'Ring', 'Rope', 'Sabre', 'Sickle', 'Sleeve', 'Sling', 'Spear', 'Spur', 'Staff', 'Star', 'Sun', 'Sword', 'Tear', 'Tower', 'Trident', 'Trumpet', 'Wand', 'Whip', 'Whistle', 'Wig']
ABSTRACTS = CONCEPTS + OBJECTS
BEASTS = ['Adder', 'Ant', 'Ass', 'Ape', 'Badger', 'Bat', 'Bear', 'Beast', 'Beaver', 'Bee', 'Beetle', 'Boar', 'Buck', 'Bull', 'Camel', 'Cat', 'Centipede', 'Charger', 'Courser', 'Crocodile', 'Deer', 'Destrier', 'Doe', 'Dog', 'Donkey', 'Elephant', 'Ewe', 'Fawn', 'Ferret', 'Fitch', 'Fly', 'Fox', 'Frog', 'Glow-worm', 'Goat', 'Grasshopper', 'Hare', 'Hedgehog', 'Hog', 'Horse', 'Hound', 'Lamb', 'Leopard', 'Lion', 'Lizard', 'Mare', 'Mole', 'Mouse', 'Newt', 'Otter', 'Ox', 'Palfrey', 'Panther', 'Pig', 'Pony', 'Porcupine', 'Ram', 'Rat', 'Serpent', 'Scorpion', 'Seal', 'Sheep', 'Snake', 'Sow', 'Spider', 'Squirrel', 'Stag', 'Stallion', 'Stoat', 'Tiger', 'Toad', 'Tortoise', 'Viper', 'Vole', 'Weasel', 'Wolf']
BIRDS = ['Bird', 'Cock', 'Coot', 'Corbie', 'Cormorant', 'Crane', 'Crow', 'Cuckoo', 'Dove', 'Duck', 'Drake', 'Eagle', 'Falcon', 'Finch', 'Gander', 'Goose', 'Grouse', 'Gull', 'Hawk', 'Heron', 'Jay', 'Kingfisher', 'Lark', 'Magpie', 'Nightingale', 'Osprey', 'Ostrich', 'Owl', 'Parrot', 'Partridge', 'Peacock', 'Pelican', 'Pheasant', 'Pigeon', 'Plover', 'Quail', 'Rail', 'Raven', 'Robin', 'Rook', 'Sparrow', 'Starling', 'Stork', 'Swallow', 'Swan', 'Swift', 'Thrush', 'Woodcock', 'Woodpecker', 'Wren']
FISH = ['Barbel', 'Barnacle', 'Burbot', 'Carp', 'Cockle', 'Crab', 'Crayfish', 'Dolphin', 'Eel', 'Fish', 'Flounder', 'Herring', 'Lamprey', 'Lobster', 'Minnow', 'Mussel', 'Octopus', 'Oyster', 'Pike', 'Plaice', 'Porpose', 'Roach', 'Salmon', 'Shark', 'Sprat', 'Sturgeon', 'Trout', 'Whale']
MONSTERS = ['Angel', 'Basilisk', 'Camelopard', 'Centaur', 'Chimera', 'Cockatrice', 'Cyclops', 'Devil', 'Dragon', 'Drake', 'Dwarf', 'Elf', 'Enfield', 'Gargoyle', 'Giant', 'Gnome', 'Goblin', 'Golem', 'Gryphon', 'Harpy', 'Hydra', 'Ibex', 'Manticore', 'Mermaid', 'Merman', 'Nymph', 'Ogre', 'Opinicus', 'Pegasus', 'Phoenix', 'Salamander', 'Satyr', 'Sea' 'Serpent', 'Siren', 'Sphinx', 'Sylph', 'Triton', 'Troll', 'Tyger', 'Unicorn', 'Wyvern']
PEOPLE = ['Abbot', 'Archer', 'Baby', 'Baker', 'Bailiff', 'Bandit', 'Barbarian', 'Baron', 'Beggar', 'Bishop', 'Blacksmith', 'Bowman', 'Bowyer', 'Boy', 'Brewer', 'Buffoon', 'Carpenter', 'Champion', 'Child', 'Clerk', 'Cobbler', 'Constable', 'Cook', 'Cooper', 'Count', 'Crone', 'Crusader', 'Dancer', 'Doctor', 'Drover', 'Druid', 'Duke', 'Earl', 'Executioner', 'Farmer', 'Ferryman', 'Fiddler', 'Fighter', 'Fisher', 'Fletcher', 'Fool', 'Forester', 'Fowler', 'Friar', 'Gardener', 'Girl', 'Greybeard', 'Guard', 'Gypsy', 'Harlequin', 'Harlot', 'Harper', 'Herder', 'Hero', 'Heroine', 'Highwayman', 'Hunter', 'Jester', 'Judge', 'King', 'Knave', 'Knight', 'Lad', 'Lady', 'Lass', 'Lord', 'Maid', 'Man', 'Marquess', 'Mason', 'Merchant', 'Miller', 'Miner', 'Minstrel', 'Monk', '[NAME]', 'Nomad', 'Nun', 'Pikeman', 'Pilgrim', 'Piper', 'Pirate', 'Player', 'Ploughman', 'Potter', 'Priest', 'Prince', 'Princess', 'Prior', 'Queen', 'Reeve', 'Rogue', 'Sage', 'Sailor', 'Saint', 'Savage', 'Scholar', 'Scriber', 'Shepherd', 'Sheriff', 'Singer', 'Soldier', 'Squire', 'Strumpet', 'Swineherd', 'Swordsman', 'Tailor', 'Thief', 'Tinker', 'Turner', 'Vintner', 'Virgin', 'Wanderer', 'Ward', 'Warrior', 'Weaver', 'Wench', 'Witch', 'Woman', 'Woodward', 'Wright', 'Youth']
BEINGS = BEASTS + BIRDS + FISH + MONSTERS + PEOPLE
ANIMAL_PARTS = ['Bladder', 'Blood', 'Bone', 'Cartilage', 'Egg', 'Eye', 'Fat', 'Feather', 'Fur', 'Gland', 'Hair', 'Heart', 'Hide', 'Honey', 'Horn', 'Kidney', 'Liver', 'Lung', 'Manure', 'Milk', 'Musk', 'Pancreas', 'Pearl', 'Saliva', 'Scales', 'Silk', 'Shell', 'Skin', 'Spleen', 'Tallow', 'Tears', 'Tongue', 'Venom', 'Wax', 'Whisker', 'Wing']
PLANT_PARTS = ['Bark', 'Bell', 'Berry', 'Blade', 'Blossom', 'Bud', 'Bulb', 'Cap', 'Chute', 'Corm', 'Crown', 'Cup', 'Flower', 'Foil', 'Frond', 'Fruit', 'Leaf', 'Mold', 'Moss', 'Needle', 'Nut', 'Pad', 'Petal', 'Root', 'Seed', 'Shoot', 'Spore', 'Sprig', 'Spur', 'Stalk', 'Stem', 'Tube', 'Vine', 'Wood']
PLANTS = ['Aster', 'Azalea', 'Carnation', 'Clover', 'Creeper', 'Dahlia', 'Daffodil', 'Daisy', 'Fern', 'Fungus', 'Geranium', 'Ginger', 'Grass', 'Herb', 'Hibiscus', 'Holly', 'Hops', 'Hyacinth', 'Hydrangea', 'Ivy', 'Lilac', 'Lily', 'Lotus', 'Magnolia', 'Marigold', 'Mushroom', 'Olive', 'Orchid', 'Peony', 'Plant', 'Poppy', 'Posy', 'Shrub', 'Sprout', 'Tea', 'Thistle', 'Truffle', 'Tulip', 'Weed', 'Wisteria']
TREES = ['Apple', 'Ash', 'Aspen', 'Beech', 'Birch', 'Catalpa', 'Cherry', 'Chestnut', 'Cottonwood', 'Cypress', 'Dogwood', 'Elm', 'Ginkgo', 'Hemlock', 'Hickory', 'Locust', 'Fir', 'Maple', 'Oak', 'Peach', 'Pear', 'Pine', 'Plum', 'Poplar', 'Spruce', 'Sumac', 'Sycamore', 'Tree', 'Walnut', 'Willow']
NOUNS = ANIMAL_PARTS + PLANT_PARTS + PLANTS + TREES
PIECES = ['Ashes', 'Cinders', 'Dust', 'Essence', 'Extract', 'Flakes', 'Muck', 'Sand', 'Salts', 'Paste', 'Powder', 'Shard']
if __name__ == '__main__':
print ingredient()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment