Files
Untitled-Cat-Game/untitled/rules.py
2026-06-24 15:46:44 -04:00

13 lines
432 B
Python

import string
def validate_cat_name(name):
ALLOWED = set(string.ascii_letters + string.digits)
if len(name) < 4 or len(name) > 24:
return "Your cat's name must be 4-24 characters long."
if not all(c in ALLOWED for c in name):
return "Your cat's name can only have letters and numbers."
if not any(c in string.ascii_letters for c in name):
return "Your cat's name needs at least 1 letter."