Advertisement
TNoStone

Untitled

Jan 21st, 2025
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 KB | None | 0 0
  1. import os
  2. import time
  3. import random
  4.  
  5. def main():
  6. while True:
  7. clear_screen()
  8. slow_print("Welcome to my Interactive Acknowledgment for the C++ Module 1 Program Compilation Review Program!\n", delay=0.02)
  9. profile = {"name": "", "is_aline": False, "hobby": None}
  10.  
  11. time.sleep(1)
  12. print("\nPress Enter to proceed to the main menu...")
  13. input()
  14. clear_screen()
  15.  
  16. main_menu(profile)
  17.  
  18. choice = input("\nWould you like to close the program? (yes/no): ").strip().lower()
  19. if choice in ["yes","y"]:
  20. print("Exiting the program.\n")
  21. break
  22.  
  23. def main_menu(profile: dict) -> None:
  24. while True:
  25. print("=== MAIN MENU ===")
  26. print("1) Continue to acknowledgment")
  27. print("2) Refuse acknowledgment (What is this, dude?)")
  28. choice = input("\nSelect an option (1 or 2): ").strip()
  29.  
  30. clear_screen()
  31.  
  32. if choice == "1":
  33. profile["name"] = input("First, I need to know: What is your name? ").strip()
  34. greet_user(profile)
  35. time.sleep(1)
  36. mini_quiz()
  37. slow_print("\nPress Enter to continue...", delay=0.02)
  38. input()
  39. clear_screen()
  40. hobby(profile)
  41. acknowledgment(profile)
  42. break
  43. elif choice == "2":
  44. slow_print("\nWow, you reject my beautiful acknowledgment? So be it.", delay=0.01)
  45. time.sleep(.8)
  46. slow_print("\nIt's probably because I wrote this in Python and this is a C++ class, isn't it?", delay=0.04)
  47. time.sleep(.4)
  48. slow_print("\nThe class just started, what do you expect?", delay=0.04)
  49. time.sleep(.8)
  50. print("\nBye!\n")
  51. time.sleep(0.3)
  52. break
  53. else:
  54. print("That wasn't a valid option. Please choose 1 or 2\n")
  55.  
  56. def greet_user(profile: dict) -> None:
  57. if is_aline(profile["name"].lower()):
  58. profile["is_aline"] = True
  59. print("\nWonderful, Aline, prepare for the best acknowledgment you have ever received!")
  60. else:
  61. profile["is_aline"] = False
  62. print(f"\nHello, {profile['name'].capitalize()}! Not Aline, but I welcome you anyway. Not sure how you got ahold of this program, but alas.")
  63.  
  64. def is_aline(name: str) -> bool:
  65. return name in {"aline", "aline yurik", "mentor aline", "mentor yurik"}
  66.  
  67. def mini_quiz():
  68. slow_print("\nRandom question...\n\n", delay=0.04)
  69. time.sleep(1.5)
  70.  
  71. options = [
  72. "How do you think I will do in this class?",
  73. " A) You’ll ace it without breaking a sweat.",
  74. " B) I think you’ll do good, but it might be a struggle.",
  75. " C) Let’s just say... I’m not overly optimistic. Especially if you're wasting time on things like this."
  76. ]
  77.  
  78. responses = {
  79. "A": "How kind. Thank you. Little do you know I am a great procrastinator >:)",
  80. "B": "A realistic approach, but success is certain!",
  81. "C": "Ouch. A bit cynical, but I'd love to prove you wrong!"
  82. }
  83.  
  84. while True:
  85. for option in options:
  86. slow_print(option, delay=0.03)
  87.  
  88. choice = input("\nEnter A, B, or C: ").strip().upper()
  89.  
  90. if choice in responses:
  91. slow_print(f"\n{responses[choice]}\n", delay=0.04)
  92.  
  93. retry = input("Would you like to change your answer? (yes/no): ").strip().lower()
  94. if retry not in ["yes", "y"]:
  95. break
  96. else:
  97. slow_print("That wasn’t one of the listed choices. Try again!\n", delay 0.01)
  98.  
  99. def hobby(profile: dict) -> None:
  100. profile["hobby"] = input("Surprise survey! What's one of your favorite hobbies or interests? ").strip()
  101. 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)
  102. slow_print("\nPress Enter to continue...", delay=0.02)
  103. input()
  104. clear_screen()
  105.  
  106. def acknowledgment(profile: dict) -> None:
  107. verses = [
  108. "\n--- Official Acknowledgment of Programs Reviewed Using a C++ Compiler ---\n",
  109.  
  110. "I have compiled and reviewed my programs with grace,",
  111. "In Visual Studio, my chosen place.",
  112. "No errors, no bugs, no glitch in sight,",
  113. "My code runs smoothly, oh what a delight!\n",
  114.  
  115. "I pressed 'Build' once, and it ran just fine,",
  116. "Not a warning appeared, not a single red line.",
  117. "The compiler obeyed, the output was true,",
  118. "So here is my acknowledgment, I've seen it through!\n",
  119.  
  120. "Would I lie? Oh, perish the thought!",
  121. "Deception and trickery? I know them not!",
  122. "Every word here is solid, as pure as can be,",
  123. "Like a contract signed and certified by me!\n",
  124.  
  125. "Alright, it’s possible, things weren’t so smooth,",
  126. "But let’s not dwell on the absolute truth.",
  127. "And yes, this being python is an obvious tell",
  128. "That struggles were had, that semicolons fell.\n",
  129.  
  130. "Please don't be mad, the Python's a joke",
  131. "It's just a quick script, not meant to provoke.",
  132. "But astonishment will be had, thus trust anew",
  133. "If my next acknowledgment is in C++, woohoo!\n"
  134. ]
  135.  
  136. for verse in verses:
  137. slow_print(verse, delay=0.03)
  138. time.sleep(0.4)
  139.  
  140. slow_print(f"\nGood luck with your {profile.get('hobby', 'hobby')}!\n", delay=0.04)
  141. farewell = f"\nThank you, {'Aline' if profile['is_aline'] else profile['name'].capitalize()}, for viewing my acknowledgment. Toodle-oo!\n"
  142. slow_print(farewell, delay=0.04)
  143.  
  144. def clear_screen():
  145. os.system("cls" if os.name == "nt" else "clear")
  146.  
  147. def slow_print(text: str, delay: float = 0.03, newline: bool = True):
  148. for char in text:
  149. print(char, end="", flush=True)
  150. time.sleep(delay)
  151. if newline:
  152. print()
  153.  
  154. if __name__ == "__main__":
  155. main()
  156.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement