From 954d429379db0cdac1c17ea1bf221c7d47f3243b Mon Sep 17 00:00:00 2001 From: caglazir Date: Sun, 14 Dec 2025 13:02:32 -0500 Subject: [PATCH] In this submission I wrapped up my game project!! I fixed up some issues that I noticed I have been having such as my answers for the input being read as wrong even though it shouldn't be. I figured out that if I had pressed another key, my strip & upper won't get rid of those keystrokes so I added a buffer between the question input and the reaction time to game stopping so that the arrows wouldn't become part of the answers. I think overall I am proud of my progress. I learned and practiced many things such as the os clear screen, classes, methods, etc. One thing that I wish I knew how to do was changing the font of certain outputs. I saw that I can do this via VSC preferences but I would love to pick and choose which texts appears in which font. The answers on stackexchange etc. seemed a bit too complex for me at the moment. But if I ever revisit this game, I would love to improve its visual aspects. If I were to implement this project in my classroom, I definitely would take some extra time practicing if/elif/else statements that are more than 3+ lines. I found that critical for my game and I think it would be applicable to many other games. Additionally, I think this game is a great wrap-up project but I can't say that the scaffolding has been appropriate or 100% relevant leading up to this point. I did not utilize majority of the other lab aspects. That could just be me though but I felt a disconnect, which I guess is also inevitable because of our course being asynchronous. In a classroom setting this could easily be managed. Overall I loved developing this and I am happy with my results, though I would love to improve upon it in the future! --- __pycache__/questioner.cpython-312.pyc | Bin 8029 -> 8311 bytes questioner.py | 35 ++++++++++++++++--------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/__pycache__/questioner.cpython-312.pyc b/__pycache__/questioner.cpython-312.pyc index 5599b5491b4e283e1bf863167b26bcf45f79ce22..5bcb46b83e05380fd9cef2de00b02f8df42b951a 100644 GIT binary patch delta 1585 zcma)6OKcle6rFKmkL~ei?0EbcfAXBBG;XMI(zHcN>cnx};Kms@{-C-brAh6IG*Z%x z9SJN41RGpFBGpCEUBwa=RYELSl{FFzoH{@n+|mULLIny?5ebCEdt*B>sUmSDU)}fa zz3B-SZB8lQ+EaL~KriXqRm)hV3O^gYN88i{eeD;avs6suWd`wY}kP;rSK4w~h7w(H- z&^@B<@T++cPUuU|7c}H%Vp;Vqd?&FLWr3|n6jf3-ce9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v+VM z+TpMhXuPX$8y!|2I|Un+`U3&mA82EOq?QtT)eU$dkwX6IJMX|}A2TcKK3LFEIUB){B*i1Wn{NMfa+h7=&ee}iMf zAxoazo*IBzA)*I+k97C-`OT~O`+NM+o>>2Z*g$tERR_IlklNP(s(73VF_7_U^$lo; zyye2g)QDk(QEY5M60#Z^j<;difJH(AFGUY+#leCYrWT1i9tCP#O}k`mPCu8G$ENM` zto)wUGpwFvz3a_GyzD9fgqJSCyCq!~=gfLG=|IObM|_1a0_Ma-+o=f3pjv)it+3j=#3Qk| zdd-@)7TkwpmdbKh!6%rMBQPklqy%T>eT+L+Ak_}-{4*F=THv9w$(pAcx2JX>Um9F3 z;jsVW#OQc3QEkZRB&HoIG^&S$4m34tvFt$-vSDXf?98$y@ZIZ%dnyZ$R1aN_*5QrX zh|K@1o;Zr>N3-(Ywe;_~-?FtP^uswWW?CtJD$+e#g!=*4T>HfZwTZvZRTjGISnuT)}V)Mks5IfEleySs|~L zBn8;)4CqB?#C6WN;EX#6cXg4G*6sRC73G zi%uBE$Z)dSs6h!3yw|P!QIKkdL2m$_d&A8utk?hf2XI6D`{(VGmqrrF(TVY)riA$n zHdfV_UqqS27xWeeo3RreS-JE7PR!KhIPaoDDEc&g%f2WPf*acb4qpY-`>G)3dtt4# a=szP0i2mK=0QC4P_$Wo{KM1Vm9sdCfMj9ai diff --git a/questioner.py b/questioner.py index 145c4d5..d9656a2 100644 --- a/questioner.py +++ b/questioner.py @@ -25,11 +25,11 @@ class Questioner: if score == 0 and self.speak: prompt = input("Questioner: Are you ready to start the game? [[Y/N]] \n") if prompt.strip().upper() == "Y": - print("Questioner: Well then, the rules are as follows... \n 1. You have 3 lives. \n 2. For every 200 points you accumulate during Starfall, you receive a question. \n 3. Each wrong answer costs you a life. You must answer 3 questions to escape this terminal. \n") + print("Questioner: Well then, the rules are as follows... \n 1. You have 3 lives. \n 2. For every 200 points you accumulate during Starfall, you receive a question. \n 3. Each wrong answer costs you a life. You must answer 3 questions to escape this terminal. \n 4. You MUST enter NUMBERS ONLY.") begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) if begin.strip().upper() == "Y": - input("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! \n (PRESS ENTER TO CONTINUE) ") + input("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! \n (PRESS ANY KEY TO CONTINUE) ") game.state["begin"] = True clear_screen() @@ -61,12 +61,12 @@ class Questioner: game.state["begin"] = False self.score_prompt += 200 self.speak = True + qbuffer = input("QUESTION INCOMING (PRESS ANY KEY TO CONTINUE) \n ") question_1 = input("Very well, here is the first question: \n What is the square root of 64? \n" ) - if question_1.strip().lower() == "8": - input("You may proceed. See you again once you reach 400 points! \n (PRESS ENTER TO CONTINUE)") - clear_screen() + if int(question_1) == 8: + print("You may proceed. See you again once you reach 400 points! \n ") else: - print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINING. \n ") game.state['lives'] = 2 proceed_1 = input("Shall we continue? [[Y/N]]") if proceed_1.strip().upper() == "Y": @@ -88,16 +88,17 @@ class Questioner: game.state["begin"] = False self.score_prompt += 200 self.speak = True - question_2 = input("What number is the element 'Argon'? \n" ) - if question_2.strip() == "18": - input("You may proceed. See you again once you reach 600 points!") - clear_screen() + qbuffer = input("QUESTION INCOMING (PRESS ANY KEY TO CONTINUE) \n ") + question_2 = input("What number is the element 'Argon'? \n") + if int(question_2) == 18: + print("You may proceed. See you again once you reach 600 points! \n") else: if life == 2: print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINING.") - game.state['lives'] = 1 + game.state['lives'] = 1 if life == 3: print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINING.") + game.state['lives'] = 2 proceed_2 = input("Shall we continue? [[Y/N]]") if proceed_2.strip().upper() == "Y": game.state["begin"] = True @@ -118,17 +119,25 @@ class Questioner: game.state["begin"] = False self.score_prompt += 200 self.speak = True - question_3 = input("How many states make up the USA? \n" ) - if question_3.strip() == "50": + qbuffer = input("QUESTION INCOMING (PRESS ANY KEY TO CONTINUE) \n ") + clear_screen() + question_3 = input("How many states make up the USA? \n") + if int(question_3) == 50: print("Correct!") + if life >= 1: + clear_screen() + print("CONGRATULATIONS! YOU MAY ESCAPE THE TERMINAL. \n") else: if life == 1: + clear_screen() print("HAHAHAHA WRONG ANSWER! YOU ARE OUT OF LIVES! \n") print("YOU LOST THE GAME!") if life == 2: + clear_screen() print("HMPH! WRONG!! BUT YOU SURVIVE WITH ONE LIFE REMAINING.") game.state["lives"] = 1 if life ==3: + clear_screen() print("HMPH! WRONG!! BUT YOU SURVIVE WITH TWO LIVES REMAINING.") game.state['lives'] = 2 self.speak = False