User:Clara/Project: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 1: Line 1:
Publication generator<br>
==Publication generator==
On the topic of fables, short stories, one liners. Generating randomised morals that teach us something.<br>
On the topic of fables, short stories, one liners. Generating randomised morals that teach us something.<br>



Revision as of 15:38, 12 October 2021

Publication generator

On the topic of fables, short stories, one liners. Generating randomised morals that teach us something.

Creating structure

Workshop at leeszaal

Coding generative stories

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