Skip to content

Instantly share code, notes, and snippets.

@PavlosMelissinos
Last active August 26, 2022 10:01
Show Gist options
  • Save PavlosMelissinos/822dabf2e9049b6296f7afa06f679ab8 to your computer and use it in GitHub Desktop.
Save PavlosMelissinos/822dabf2e9049b6296f7afa06f679ab8 to your computer and use it in GitHub Desktop.
Shakespeare Insult Generator
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Shakespeare Insult Generator

Description

Welcome to the shakespearean insult generator (based on Shakespeare insult kit)!

This gist contains 5 files (6 including this)!

  • insult.py -> code
  • w1.txt -> 1st wordset
  • w2.txt -> 2nd wordset
  • w3.txt -> 3rd wordset
  • insult.ipynb -> simple jupyter notebook

Usage

python insult.py

Advanced Usage

python insult.py <list of wordsets> python insult.py is equivalent to python insult.py w1.txt w2.txt w3.txt

Have fun!

import functools
import random
import sys
def applyto(*args):
return functools.reduce(lambda l, r: r(l), args)
def read_file(filename):
content = None
with open(filename) as fin:
content = [line.rstrip('\n') for line in fin]
return content
def combine(*args):
return [random.choice(arg) for arg in args]
def format_insult(lst):
return ' '.join(['Thou'] + lst) + '!'
def insult(*args):
return applyto(
[read_file(it) for it in list(args)],
lambda content: combine(*content),
format_insult
)
if __name__ == "__main__":
filenames = ['w1.txt', 'w2.txt', 'w3.txt']
filenames = sys.argv[1:] or filenames
print(insult(*filenames))
artless
bawdy
beslubbering
bootless
churlish
cockered
clouted
craven
currish
dankish
dissembling
droning
errant
fawning
fobbing
froward
frothy
gleeking
goatish
gorbellied
impertinent
infectious
jarring
loggerheaded
lumpish
mammering
mangled
mewling
paunchy
pribbling
puking
puny
qualling
rank
reeky
roguish
ruttish
saucy
spleeny
spongy
surly
tottering
unmuzzled
vain
venomed
villainous
warped
wayward
weedy
yeasty
cullionly
fusty
caluminous
wimpled
burly-boned
misbegotten
odiferous
poisonous
fishified
Wart-necked
base-court
bat-fowling
beef-witted
beetle-headed
boil-brained
clapper-clawed
clay-brained
common-kissing
crook-pated
dismal-dreaming
dizzy-eyed
doghearted
dread-bolted
earth-vexing
elf-skinned
fat-kidneyed
fen-sucked
flap-mouthed
fly-bitten
folly-fallen
fool-born
full-gorged
guts-griping
half-faced
hasty-witted
hedge-born
hell-hated
idle-headed
ill-breeding
ill-nurtured
knotty-pated
milk-livered
motley-minded
onion-eyed
plume-plucked
pottle-deep
pox-marked
reeling-ripe
rough-hewn
rude-growing
rump-fed
shard-borne
sheep-biting
spur-galled
swag-bellied
tardy-gaited
tickle-brained
toad-spotted
unchin-snouted
weather-bitten
whoreson
malmsey-nosed
rampallian
lily-livered
scurvy-valiant
brazen-faced
unwash'd
bunch-back'd
leaden-footed
muddy-mettled
pigeon-liver'd
scale-sided
apple-john
baggage
barnacle
bladder
boar-pig
bugbear
bum-bailey
canker-blossom
clack-dish
clotpole
coxcomb
codpiece
death-token
dewberry
flap-dragon
flax-wench
flirt-gill
foot-licker
fustilarian
giglet
gudgeon
haggard
harpy
hedge-pig
horn-beast
hugger-mugger
joithead
lewdster
lout
maggot-pie
malt-worm
mammet
measle
minnow
miscreant
moldwarp
mumble-news
nut-hook
pigeon-egg
pignut
puttock
pumpion
ratsbane
scut
skainsmate
strumpet
varlot
vassal
whey-face
wagtail
knave
blind-worm
popinjay
scullian
jolt-head
malcontent
devil-monk
toad
rascal
Basket-Cockle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment