adoption flow

This commit is contained in:
2026-06-24 15:46:44 -04:00
parent 13b8cd4b5e
commit b644ce5216
5 changed files with 35 additions and 8 deletions

View File

@@ -1,10 +1,10 @@
from untitled import generation, ui
from untitled import generation, ui, rules, model
def adoption():
print("Welcome to the shelter!")
name = None
while not name:
while True:
choice = "Reroll"
while choice == "Reroll":
choices = generation.generate_cat_choices()
@@ -12,4 +12,16 @@ def adoption():
"Please choose a cat to adopt:",
[ui.Choice(cat[0], cat[1]) for cat in choices] + ["Reroll"],
)
name = ui.text("Please choose a name for your cat:")
while True:
name = ui.text("Please choose a name for your cat:")
error = rules.validate_cat_name(name)
if not error:
break
print(error)
if ui.confirm(
f"Do you want to adopt {name}, {generation.generate_trait_sentence(choice).lower()}?"
):
break
return model.Cat(name, choice)