Genimi: Mood-Based Poem Generator
Description
This chatbot uses a simple rule-based system to generate short poems based on user-inputted moods. The poems are intentionally simplistic for demonstration purposes.
Code Snippet
import random
moods = {
"happy": ["Sunshine fills the sky,", "Laughter dances light,", "Joyful birds all fly,", "Everything feels bright."],
"sad": ["Grey clouds fill the air,", "Tears fall like the rain,", "Heartbreak and despair,", "Washing away the pain."],
"angry": ["Fists clenched tight and strong,", "Anger burns within,", "Wrongs that cause such wrong,", "A battle to begin."],
}
def generate_poem(mood):
if mood.lower() in moods:
lines = random.sample(moods[mood.lower()], 4)
return "\n".join(lines)
else:
return "I don't understand that mood."
user_mood = input("Enter your mood (happy, sad, angry): ")
poem = generate_poem(user_mood)
print(poem)