From cdfd01b053b71c2b7c48e341182639b0a9d2cf90 Mon Sep 17 00:00:00 2001 From: Toasterkitten Date: Tue, 23 Jun 2026 08:23:07 -0400 Subject: [PATCH] gtg again --- untitled/app.py | 33 ++------------------------------- untitled/generation.py | 23 +++++++++++++++++++++++ untitled/screens.py | 12 ++++++++++++ 3 files changed, 37 insertions(+), 31 deletions(-) create mode 100644 untitled/generation.py create mode 100644 untitled/screens.py diff --git a/untitled/app.py b/untitled/app.py index 0cd095e..71bcfdb 100644 --- a/untitled/app.py +++ b/untitled/app.py @@ -1,27 +1,6 @@ -import random import time -from untitled import content, 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] +from untitled import content, screens, ui class App: @@ -49,12 +28,4 @@ class App: "New Game" ): # the current unixtime is 1782171466 as of writing this comment, oh wait, that would create a paradox, wait, nevermind, ESTIMATE OKAY? # yayyyyy - print("Welcome to the shelter!") - 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"], - ) + screens.adoption() diff --git a/untitled/generation.py b/untitled/generation.py new file mode 100644 index 0000000..c2b94b1 --- /dev/null +++ b/untitled/generation.py @@ -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] diff --git a/untitled/screens.py b/untitled/screens.py new file mode 100644 index 0000000..ed29014 --- /dev/null +++ b/untitled/screens.py @@ -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"], + )