User:Clara/Project: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 33: Line 33:
     print(f"And so the day {e}")
     print(f"And so the day {e}")
</source>
</source>
<pr>
<p>
Output example:
Output example:
On a cold evening
On a cold evening
Line 42: Line 42:
Hoping to feel happier
Hoping to feel happier
And so the day started
And so the day started
</pr>
</p>

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}")

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