Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import random
- def main():
- while True:
- clear_screen()
- slow_print("Welcome to my Interactive Acknowledgment for the C++ Module 1 Program Compilation Review Program!\n", delay=0.02)
- profile = {"name": "", "is_aline": False, "hobby": None}
- time.sleep(1)
- print("\nPress Enter to proceed to the main menu...")
- input()
- clear_screen()
- main_menu(profile)
- choice = input("\nWould you like to close the program? (yes/no): ").strip().lower()
- if choice in ["yes","y"]:
- print("Exiting the program.\n")
- break
- def main_menu(profile: dict) -> None:
- while True:
- print("=== MAIN MENU ===")
- print("1) Continue to acknowledgment")
- print("2) Refuse acknowledgment (What is this, dude?)")
- choice = input("\nSelect an option (1 or 2): ").strip()
- clear_screen()
- if choice == "1":
- profile["name"] = input("First, I need to know: What is your name? ").strip()
- greet_user(profile)
- time.sleep(1)
- mini_quiz()
- slow_print("\nPress Enter to continue...", delay=0.02)
- input()
- clear_screen()
- hobby(profile)
- acknowledgment(profile)
- break
- elif choice == "2":
- slow_print("\nWow, you reject my beautiful acknowledgment? So be it.", delay=0.01)
- time.sleep(.8)
- slow_print("\nIt's probably because I wrote this in Python and this is a C++ class, isn't it?", delay=0.04)
- time.sleep(.4)
- slow_print("\nThe class just started, what do you expect?", delay=0.04)
- time.sleep(.8)
- print("\nBye!\n")
- time.sleep(0.3)
- break
- else:
- print("That wasn't a valid option. Please choose 1 or 2\n")
- def greet_user(profile: dict) -> None:
- if is_aline(profile["name"].lower()):
- profile["is_aline"] = True
- print("\nWonderful, Aline, prepare for the best acknowledgment you have ever received!")
- else:
- profile["is_aline"] = False
- print(f"\nHello, {profile['name'].capitalize()}! Not Aline, but I welcome you anyway. Not sure how you got ahold of this program, but alas.")
- def is_aline(name: str) -> bool:
- return name in {"aline", "aline yurik", "mentor aline", "mentor yurik"}
- def mini_quiz():
- slow_print("\nRandom question...\n\n", delay=0.04)
- time.sleep(1.5)
- options = [
- "How do you think I will do in this class?",
- " A) You’ll ace it without breaking a sweat.",
- " B) I think you’ll do good, but it might be a struggle.",
- " C) Let’s just say... I’m not overly optimistic. Especially if you're wasting time on things like this."
- ]
- responses = {
- "A": "How kind. Thank you. Little do you know I am a great procrastinator >:)",
- "B": "A realistic approach, but success is certain!",
- "C": "Ouch. A bit cynical, but I'd love to prove you wrong!"
- }
- while True:
- for option in options:
- slow_print(option, delay=0.03)
- choice = input("\nEnter A, B, or C: ").strip().upper()
- if choice in responses:
- slow_print(f"\n{responses[choice]}\n", delay=0.04)
- retry = input("Would you like to change your answer? (yes/no): ").strip().lower()
- if retry not in ["yes", "y"]:
- break
- else:
- slow_print("That wasn’t one of the listed choices. Try again!\n", delay 0.01)
- def hobby(profile: dict) -> None:
- profile["hobby"] = input("Surprise survey! What's one of your favorite hobbies or interests? ").strip()
- slow_print("\nThank you for the survey. Your data will be a valuable asset to our marketing team. Let's continue.\n", delay=0.04)
- slow_print("\nPress Enter to continue...", delay=0.02)
- input()
- clear_screen()
- def acknowledgment(profile: dict) -> None:
- verses = [
- "\n--- Official Acknowledgment of Programs Reviewed Using a C++ Compiler ---\n",
- "I have compiled and reviewed my programs with grace,",
- "In Visual Studio, my chosen place.",
- "No errors, no bugs, no glitch in sight,",
- "My code runs smoothly, oh what a delight!\n",
- "I pressed 'Build' once, and it ran just fine,",
- "Not a warning appeared, not a single red line.",
- "The compiler obeyed, the output was true,",
- "So here is my acknowledgment, I've seen it through!\n",
- "Would I lie? Oh, perish the thought!",
- "Deception and trickery? I know them not!",
- "Every word here is solid, as pure as can be,",
- "Like a contract signed and certified by me!\n",
- "Alright, it’s possible, things weren’t so smooth,",
- "But let’s not dwell on the absolute truth.",
- "And yes, this being python is an obvious tell",
- "That struggles were had, that semicolons fell.\n",
- "Please don't be mad, the Python's a joke",
- "It's just a quick script, not meant to provoke.",
- "But astonishment will be had, thus trust anew",
- "If my next acknowledgment is in C++, woohoo!\n"
- ]
- for verse in verses:
- slow_print(verse, delay=0.03)
- time.sleep(0.4)
- slow_print(f"\nGood luck with your {profile.get('hobby', 'hobby')}!\n", delay=0.04)
- farewell = f"\nThank you, {'Aline' if profile['is_aline'] else profile['name'].capitalize()}, for viewing my acknowledgment. Toodle-oo!\n"
- slow_print(farewell, delay=0.04)
- def clear_screen():
- os.system("cls" if os.name == "nt" else "clear")
- def slow_print(text: str, delay: float = 0.03, newline: bool = True):
- for char in text:
- print(char, end="", flush=True)
- time.sleep(delay)
- if newline:
- print()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement