gtg again
This commit is contained in:
23
untitled/generation.py
Normal file
23
untitled/generation.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import random
|
||||
|
||||
from untitled import content
|
||||
|
||||
|
||||
def generate_cat_choice(personality=None):
|
||||
size = random.choice(content.CAT_SIZES)
|
||||
color = random.choice(content.CAT_COLORS)
|
||||
eyes = random.choice(content.CAT_EYE_COLORS)
|
||||
personality = personality or random.choice(content.CAT_PERSONALITIES)
|
||||
article = "An" if size[0] in "aeiou" else "A"
|
||||
description = f"{article} {size} {color} kitten with {eyes} eyes who {personality}"
|
||||
return description, {
|
||||
"size": size,
|
||||
"color": color,
|
||||
"eyes": eyes,
|
||||
"personality": personality,
|
||||
}
|
||||
|
||||
|
||||
def generate_cat_choices(n=5):
|
||||
personalities = random.sample(content.CAT_PERSONALITIES, n)
|
||||
return [generate_cat_choice(p) for p in personalities]
|
||||
Reference in New Issue
Block a user