Last active
August 30, 2015 11:08
-
-
Save AzMoo/93b6ad2a08fd551617bc to your computer and use it in GitHub Desktop.
A test gist to write I beat poem I stole from here: http://blog.trinket.io/writing-poetry-in-python/
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
from random import choice, randint | |
## Beat poetry | |
adjectives = "radiant bright ecstatic young lithe driving running splitting".split() | |
verbs = "wriggles grows stares saunters drives smiles raps".split() | |
nouns = "pen inkwell willow sky station train pane window sunlight dust".split() | |
def beat_poem(): | |
print "\n" + "="*16+" a poem " + "="*16 | |
for x in range(randint(5,11)): | |
words1 = " ".join([choice(adjectives) + ", ", choice(adjectives)]) | |
words2 = " ".join([choice(nouns), choice(verbs)]) | |
words3 = " ".join([choice(nouns), choice(nouns), choice(adjectives), choice(nouns)]) | |
for i in range(randint(2,5)): | |
words = choice([words1, words2, words3]) | |
line = " "*randint(0, 40 - len(words)) + words | |
print line | |
if x % 3 ==0: | |
print " "*5 + choice(nouns) | |
print " "*5 + choice(nouns) | |
print " "*5 + "the " + choice(nouns) +"!" | |
if x % 7 ==0: | |
words4 = " ".join(["the " + choice(adjectives), choice(nouns), choice(verbs)]) | |
print " ".join(words4) | |
beat_poem() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment