gtg again

This commit is contained in:
2026-06-23 08:23:07 -04:00
parent 67cdcbca69
commit cdfd01b053
3 changed files with 37 additions and 31 deletions

View File

@@ -1,27 +1,6 @@
import random
import time import time
from untitled import content, ui from untitled import content, screens, ui
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]
class App: class App:
@@ -49,12 +28,4 @@ class App:
"New Game" "New Game"
): # the current unixtime is 1782171466 as of writing this comment, oh wait, that would create a paradox, wait, nevermind, ESTIMATE OKAY? ): # the current unixtime is 1782171466 as of writing this comment, oh wait, that would create a paradox, wait, nevermind, ESTIMATE OKAY?
# yayyyyy # yayyyyy
print("Welcome to the shelter!") screens.adoption()
choice = "Reroll"
while choice == "Reroll":
choices = generate_cat_choices()
choice = ui.select(
"Please choose a cat to adopt!",
list(ui.Choice(cat[0], cat[1]) for cat in choices)
+ ["Reroll"],
)

23
untitled/generation.py Normal file
View 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]

12
untitled/screens.py Normal file
View File

@@ -0,0 +1,12 @@
from untitled import generation, ui
def adoption():
print("Welcome to the shelter!")
choice = "Reroll"
while choice == "Reroll":
choices = generation.generate_cat_choices()
choice = ui.select(
"Please choose a cat to adopt!",
list(ui.Choice(cat[0], cat[1]) for cat in choices) + ["Reroll"],
)