Untitled
unknown
plain_text
10 months ago
2.1 kB
12
Indexable
# birthday_game.py
import time
from colorama import Fore, Style, init
# Initialize colorama
init(autoreset=True)
def type_print(message, delay=0.05):
"""Print letters one by one like animation"""
for char in message:
print(char, end='', flush=True)
time.sleep(delay)
print()
# Step 1: Ask sister's name
sister_name = input(Fore.MAGENTA + "Enter your sister's name: " + Style.RESET_ALL)
# Step 2: Welcome message
type_print(Fore.CYAN + f"\nπ Happy Birthday, {sister_name}! π" + Style.RESET_ALL, 0.08)
type_print(Fore.YELLOW + "Let's play a little birthday surprise game! π\n" + Style.RESET_ALL, 0.05)
# Step 3: Show options
type_print("Choose your surprise by entering a number:\n")
type_print("1. π Cake")
type_print("2. π Gift")
type_print("3. π Balloons")
choice = input(Fore.MAGENTA + "\nYour choice (1/2/3): " + Style.RESET_ALL)
# Step 4: Display based on choice
if choice == "1":
cake = """
,,,,,,
| HAPPY |
| BIRTH |
| DAY!! |
`""""""`
[|||]
[|||]
[|||]
"""
type_print(Fore.RED + cake + Style.RESET_ALL)
type_print(Fore.CYAN + "Yay! Hereβs your virtual cake! π°" + Style.RESET_ALL)
elif choice == "2":
gift = """
_______
/ \\
| ππ |
|_______|
"""
type_print(Fore.GREEN + gift + Style.RESET_ALL)
type_print(Fore.CYAN + "Surprise! You got a virtual gift! π" + Style.RESET_ALL)
elif choice == "3":
balloons = """
π π π
π π π
π π π
"""
type_print(Fore.MAGENTA + balloons + Style.RESET_ALL)
type_print(Fore.CYAN + "Look! Your balloons are flying! ππ" + Style.RESET_ALL)
else:
type_print(Fore.RED + "Oops! Invalid choice, but still wishing you a wonderful day! π" + Style.RESET_ALL)
# Step 5: Ending message
type_print(Fore.YELLOW + f"\nHope you enjoyed your surprises, {sister_name}! π" + Style.RESET_ALL)
type_print(Fore.CYAN + "May your day be filled with happiness, love, and fun! π" + Style.RESET_ALL)
Editor is loading...
Leave a Comment