User:Clara/Project: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "Publication generator<br> On the topic of fables, short stories, one liners. Generating randomised morals that teach us something.")
 
No edit summary
Line 1: Line 1:
Publication generator<br>
Publication generator<br>
On the topic of fables, short stories, one liners. Generating randomised morals that teach us something.
On the topic of fables, short stories, one liners. Generating randomised morals that teach us something.<br>
<br>
 
<source lang="python">
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}")
 
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
</source>

Revision as of 15:31, 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}")

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