Untitled

 avatar
unknown
python
a year ago
1.4 kB
6
Indexable
import random
import time
from art import *
from random_words import RandomWords

# Function to generate random ASCII art
def random_art():
    art_list = [text2art, aprint, tprint]
    art_func = random.choice(art_list)
    art_name = random.choice(art.list())
    return art_func(art_name)

# Function to generate a random quote
def random_quote():
    quotes = [
        "To be or not to be, that is the question.",
        "The only thing we have to fear is fear itself.",
        "I think, therefore I am.",
        "In the beginning, there was nothing, which exploded.",
        "Do not go gentle into that good night."
    ]
    return random.choice(quotes)

# Function to generate random poetry
def random_poetry():
    words = RandomWords().random_words(count=10)
    lines = [
        f"{random.choice(words).capitalize()} {random.choice(words)} {random.choice(words)}",
        f"{random.choice(words).capitalize()} {random.choice(words)} {random.choice(words)}",
        f"{random.choice(words).capitalize()} {random.choice(words)} {random.choice(words)}"
    ]
    return "\n".join(lines)

# Main function to display the "symphony"
def symphony():
    while True:
        print(random_art())
        time.sleep(1)
        print(random_quote())
        time.sleep(1)
        print(random_poetry())
        time.sleep(2)
        print("\n" + "="*40 + "\n")

if __name__ == "__main__":
    symphony()
Editor is loading...