User:Clara/Project: Difference between revisions
No edit summary |
No edit summary |
||
Line 32: | Line 32: | ||
print(f"Hoping to {m}") | print(f"Hoping to {m}") | ||
print(f"And so the day {e}") | print(f"And so the day {e}") | ||
</source> | |||
<pr> | |||
Output example: | |||
On a cold evening | |||
Appeared a dog and a pen | Appeared a dog and a pen | ||
They found themselves in a school | They found themselves in a school | ||
Line 39: | Line 41: | ||
They were there to get therapy | They were there to get therapy | ||
Hoping to feel happier | Hoping to feel happier | ||
And so the day started | And so the day started | ||
</ | </pr> |
Revision as of 15:33, 12 October 2021
Publication generator
On the topic of fables, short stories, one liners. Generating randomised morals that teach us something.
intro = ("sunny day", "day unlike an other", "cold evening", "gloomy day")
character = ("cat", "pen", "dog", "tree")
characters = ("cat", "pen", "dog", "tree")
location = ("parking lot", "sauna", "school")
object = ("flag", "ladder", "banana", "lunchbox")
action = ("protest", "study", "get therapy")
moral = ("make a difference", "learn from each other", "feel happier")
end = ("ended", "continued", "started")
import random
i = random.choice(intro)
c = random.choice(character)
h = random.choice(characters)
l = random.choice(location)
o = random.choice(object)
a = random.choice(action)
m = random.choice(moral)
e = random.choice(end)
for x in range (1):
print(f"On a {i}")
print(f"Appeared a {c} and a {h}")
print(f"They found themselves in a {l}")
print(f"The {c} had brought a {o}")
print(f"They were there to {a}")
print(f"Hoping to {m}")
print(f"And so the day {e}")
<pr> Output example: On a cold evening Appeared a dog and a pen They found themselves in a school The dog had brought a lunchbox They were there to get therapy Hoping to feel happier And so the day started </pr>