From 3d6773be0a31becc401639ccf1e6e8fce132a29a Mon Sep 17 00:00:00 2001 From: caglazir Date: Fri, 12 Dec 2025 22:55:30 -0500 Subject: [PATCH] In this submission, I worked on my question spawns This was honestly a difficult submission. There were moments when I wanted to just quit. I tried so hard to figure out why certain things wouldnt happen (such as my starfall spawn not stopping once the milestone score is reached). It took me soooo many trials and errors and bunch of researching to figure out how to troubleshoot. I feel like this was an enormous learning experience and I am overall proud of my game so far. However there is a lot of clean up to do. My "lives" mechanic is still not in place. What I have in place is temporary until I can figure out the play/pause mechanic with the point system. I also currently have NO IDEA how to remove the text from the screen. During the question phase the texts overlap. Might have to keep researching that or I might send a message to the server. Overall I feel like I learned how to THINK for creating games and placing a bunch of conditional statements that flow one after the other. I am loving the productive struggle!! --- .history/questioner_20251212220508.py | 68 +++++++++++ .history/questioner_20251212222328.py | 68 +++++++++++ .history/questioner_20251212222330.py | 68 +++++++++++ .history/questioner_20251212222541.py | 67 +++++++++++ .history/questioner_20251212222542.py | 67 +++++++++++ .history/questioner_20251212222621.py | 67 +++++++++++ .history/questioner_20251212222622.py | 67 +++++++++++ .history/questioner_20251212222650.py | 67 +++++++++++ .history/questioner_20251212222651.py | 67 +++++++++++ .history/questioner_20251212223407.py | 68 +++++++++++ .history/questioner_20251212223408.py | 68 +++++++++++ .history/questioner_20251212223557.py | 68 +++++++++++ .history/questioner_20251212223558.py | 68 +++++++++++ .history/questioner_20251212223835.py | 70 +++++++++++ .history/questioner_20251212223836.py | 70 +++++++++++ .history/questioner_20251212224035.py | 70 +++++++++++ .history/questioner_20251212224036.py | 70 +++++++++++ .history/questioner_20251212224418.py | 90 ++++++++++++++ .history/questioner_20251212224419.py | 90 ++++++++++++++ .history/questioner_20251212224437.py | 93 +++++++++++++++ .history/questioner_20251212224438.py | 93 +++++++++++++++ .history/questioner_20251212224638.py | 93 +++++++++++++++ .history/questioner_20251212224639.py | 93 +++++++++++++++ .history/questioner_20251212225454.py | 116 ++++++++++++++++++ .history/starfall_game_20251212211111.py | 11 ++ .history/starfall_game_20251212225458.py | 11 ++ .history/starfall_spawner_20251212220756.py | 18 +++ .history/starfall_spawner_20251212222744.py | 18 +++ __pycache__/person.cpython-312.pyc | Bin 1310 -> 1310 bytes __pycache__/questioner.cpython-312.pyc | Bin 2094 -> 5190 bytes __pycache__/starfall.cpython-311.pyc | Bin 0 -> 1305 bytes __pycache__/starfall.cpython-312.pyc | Bin 1162 -> 1162 bytes __pycache__/starfall_spawner.cpython-312.pyc | Bin 1279 -> 1284 bytes questioner.py | 118 ++++++++++++++++--- starfall_game.py | 2 +- starfall_spawner.py | 3 +- 36 files changed, 1989 insertions(+), 18 deletions(-) create mode 100644 .history/questioner_20251212220508.py create mode 100644 .history/questioner_20251212222328.py create mode 100644 .history/questioner_20251212222330.py create mode 100644 .history/questioner_20251212222541.py create mode 100644 .history/questioner_20251212222542.py create mode 100644 .history/questioner_20251212222621.py create mode 100644 .history/questioner_20251212222622.py create mode 100644 .history/questioner_20251212222650.py create mode 100644 .history/questioner_20251212222651.py create mode 100644 .history/questioner_20251212223407.py create mode 100644 .history/questioner_20251212223408.py create mode 100644 .history/questioner_20251212223557.py create mode 100644 .history/questioner_20251212223558.py create mode 100644 .history/questioner_20251212223835.py create mode 100644 .history/questioner_20251212223836.py create mode 100644 .history/questioner_20251212224035.py create mode 100644 .history/questioner_20251212224036.py create mode 100644 .history/questioner_20251212224418.py create mode 100644 .history/questioner_20251212224419.py create mode 100644 .history/questioner_20251212224437.py create mode 100644 .history/questioner_20251212224438.py create mode 100644 .history/questioner_20251212224638.py create mode 100644 .history/questioner_20251212224639.py create mode 100644 .history/questioner_20251212225454.py create mode 100644 .history/starfall_game_20251212211111.py create mode 100644 .history/starfall_game_20251212225458.py create mode 100644 .history/starfall_spawner_20251212220756.py create mode 100644 .history/starfall_spawner_20251212222744.py create mode 100644 __pycache__/starfall.cpython-311.pyc diff --git a/.history/questioner_20251212220508.py b/.history/questioner_20251212220508.py new file mode 100644 index 0000000..623aae4 --- /dev/null +++ b/.history/questioner_20251212220508.py @@ -0,0 +1,68 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + return + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222328.py b/.history/questioner_20251212222328.py new file mode 100644 index 0000000..8b2044a --- /dev/null +++ b/.history/questioner_20251212222328.py @@ -0,0 +1,68 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + return + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222330.py b/.history/questioner_20251212222330.py new file mode 100644 index 0000000..8b2044a --- /dev/null +++ b/.history/questioner_20251212222330.py @@ -0,0 +1,68 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + return + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222541.py b/.history/questioner_20251212222541.py new file mode 100644 index 0000000..9c7c553 --- /dev/null +++ b/.history/questioner_20251212222541.py @@ -0,0 +1,67 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222542.py b/.history/questioner_20251212222542.py new file mode 100644 index 0000000..9c7c553 --- /dev/null +++ b/.history/questioner_20251212222542.py @@ -0,0 +1,67 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222621.py b/.history/questioner_20251212222621.py new file mode 100644 index 0000000..9795e50 --- /dev/null +++ b/.history/questioner_20251212222621.py @@ -0,0 +1,67 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= 200 and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222622.py b/.history/questioner_20251212222622.py new file mode 100644 index 0000000..9795e50 --- /dev/null +++ b/.history/questioner_20251212222622.py @@ -0,0 +1,67 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= 200 and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222650.py b/.history/questioner_20251212222650.py new file mode 100644 index 0000000..b9a1d11 --- /dev/null +++ b/.history/questioner_20251212222650.py @@ -0,0 +1,67 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212222651.py b/.history/questioner_20251212222651.py new file mode 100644 index 0000000..b9a1d11 --- /dev/null +++ b/.history/questioner_20251212222651.py @@ -0,0 +1,67 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212223407.py b/.history/questioner_20251212223407.py new file mode 100644 index 0000000..c5b04cf --- /dev/null +++ b/.history/questioner_20251212223407.py @@ -0,0 +1,68 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212223408.py b/.history/questioner_20251212223408.py new file mode 100644 index 0000000..c5b04cf --- /dev/null +++ b/.history/questioner_20251212223408.py @@ -0,0 +1,68 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt and self.speak: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212223557.py b/.history/questioner_20251212223557.py new file mode 100644 index 0000000..58b1394 --- /dev/null +++ b/.history/questioner_20251212223557.py @@ -0,0 +1,68 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212223558.py b/.history/questioner_20251212223558.py new file mode 100644 index 0000000..58b1394 --- /dev/null +++ b/.history/questioner_20251212223558.py @@ -0,0 +1,68 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'?" ) + if question_1.strip().upper() == "Demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212223835.py b/.history/questioner_20251212223835.py new file mode 100644 index 0000000..6c8f5a8 --- /dev/null +++ b/.history/questioner_20251212223835.py @@ -0,0 +1,70 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'? \n" ) + if question_1.strip().lower() == "demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212223836.py b/.history/questioner_20251212223836.py new file mode 100644 index 0000000..6c8f5a8 --- /dev/null +++ b/.history/questioner_20251212223836.py @@ -0,0 +1,70 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things'? \n" ) + if question_1.strip().lower() == "demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212224035.py b/.history/questioner_20251212224035.py new file mode 100644 index 0000000..23df96e --- /dev/null +++ b/.history/questioner_20251212224035.py @@ -0,0 +1,70 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things' called? \n" ) + if question_1.strip().lower() == "demo": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212224036.py b/.history/questioner_20251212224036.py new file mode 100644 index 0000000..23df96e --- /dev/null +++ b/.history/questioner_20251212224036.py @@ -0,0 +1,70 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things' called? \n" ) + if question_1.strip().lower() == "demo": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + + diff --git a/.history/questioner_20251212224418.py b/.history/questioner_20251212224418.py new file mode 100644 index 0000000..9819ac1 --- /dev/null +++ b/.history/questioner_20251212224418.py @@ -0,0 +1,90 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things' called? \n" ) + if question_1.strip().lower() == "demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + diff --git a/.history/questioner_20251212224419.py b/.history/questioner_20251212224419.py new file mode 100644 index 0000000..9819ac1 --- /dev/null +++ b/.history/questioner_20251212224419.py @@ -0,0 +1,90 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things' called? \n" ) + if question_1.strip().lower() == "demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + diff --git a/.history/questioner_20251212224437.py b/.history/questioner_20251212224437.py new file mode 100644 index 0000000..165d7f8 --- /dev/null +++ b/.history/questioner_20251212224437.py @@ -0,0 +1,93 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_2(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things' called? \n" ) + if question_1.strip().lower() == "demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + diff --git a/.history/questioner_20251212224438.py b/.history/questioner_20251212224438.py new file mode 100644 index 0000000..165d7f8 --- /dev/null +++ b/.history/questioner_20251212224438.py @@ -0,0 +1,93 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_2(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_1 = input("Very well, here is the first question: \n What is the monster from the first season of 'Stranger Things' called? \n" ) + if question_1.strip().lower() == "demogorgon": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + diff --git a/.history/questioner_20251212224638.py b/.history/questioner_20251212224638.py new file mode 100644 index 0000000..3f86e37 --- /dev/null +++ b/.history/questioner_20251212224638.py @@ -0,0 +1,93 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_2(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + 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": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + diff --git a/.history/questioner_20251212224639.py b/.history/questioner_20251212224639.py new file mode 100644 index 0000000..3f86e37 --- /dev/null +++ b/.history/questioner_20251212224639.py @@ -0,0 +1,93 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_2(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + 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": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + + diff --git a/.history/questioner_20251212225454.py b/.history/questioner_20251212225454.py new file mode 100644 index 0000000..99970c9 --- /dev/null +++ b/.history/questioner_20251212225454.py @@ -0,0 +1,116 @@ +class Questioner: + name = "Questioner" + character = '?' + + def __init__(self, board_size): + board_width, board_height = board_size + self.position = (board_width // 2, board_height // 2) + self.score_prompt = 200 + self.speak = True + + def play_turn(self,game): + score=game.state.get("score", 0) + person = game.get_agent_by_name('Person') + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") + + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_2(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_3(game) + + + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + 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": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_3(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_3 = input("Last question: \n Which country is home to Bosphorus? \n" ) + if question_3.strip().lower() == "turkey": + print("Correct!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_3 = input("Shall we continue? [[Y/N]]") + if proceed_3.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + + + diff --git a/.history/starfall_game_20251212211111.py b/.history/starfall_game_20251212211111.py new file mode 100644 index 0000000..8117a49 --- /dev/null +++ b/.history/starfall_game_20251212211111.py @@ -0,0 +1,11 @@ +from retro.game import Game +from person import Person +from questioner import Questioner +from starfall_spawner import StarfallSpawner + +board_size = (50, 30) +player = Person(board_size) +questioner = Questioner(board_size) +spawner = StarfallSpawner() +game = Game([player, questioner, spawner], {"score": 0, "lives": 3, "begin": False}, board_size=board_size) +game.play() diff --git a/.history/starfall_game_20251212225458.py b/.history/starfall_game_20251212225458.py new file mode 100644 index 0000000..8117a49 --- /dev/null +++ b/.history/starfall_game_20251212225458.py @@ -0,0 +1,11 @@ +from retro.game import Game +from person import Person +from questioner import Questioner +from starfall_spawner import StarfallSpawner + +board_size = (50, 30) +player = Person(board_size) +questioner = Questioner(board_size) +spawner = StarfallSpawner() +game = Game([player, questioner, spawner], {"score": 0, "lives": 3, "begin": False}, board_size=board_size) +game.play() diff --git a/.history/starfall_spawner_20251212220756.py b/.history/starfall_spawner_20251212220756.py new file mode 100644 index 0000000..1ad1cca --- /dev/null +++ b/.history/starfall_spawner_20251212220756.py @@ -0,0 +1,18 @@ +from random import randint +from starfall import Star + +class StarfallSpawner: + display = False + + def play_turn(self, game): + if not game.state.get("begin", False): + return + width, height = game.board_size + game.state['score'] += 1 + if self.should_spawn_star(game.turn_number): + star = Star((randint(0, width - 1), 0)) + game.add_agent(star) + + + def should_spawn_star(self, turn_number): + return randint(0, 1000) < turn_number \ No newline at end of file diff --git a/.history/starfall_spawner_20251212222744.py b/.history/starfall_spawner_20251212222744.py new file mode 100644 index 0000000..449f543 --- /dev/null +++ b/.history/starfall_spawner_20251212222744.py @@ -0,0 +1,18 @@ +from random import randint +from starfall import Star + +class StarfallSpawner: + display = False + + def play_turn(self, game): + if not game.state.get("begin", True): + return + width, height = game.board_size + game.state['score'] += 1 + if self.should_spawn_star(game.turn_number): + star = Star((randint(0, width - 1), 0)) + game.add_agent(star) + + + def should_spawn_star(self, turn_number): + return randint(0, 1000) < turn_number \ No newline at end of file diff --git a/__pycache__/person.cpython-312.pyc b/__pycache__/person.cpython-312.pyc index 318f7a6928732da05cc256621484468d004eb030..96557d9611a6730ddd357db40cdba6734461a0dd 100644 GIT binary patch delta 20 acmbQoHIIw?G%qg~0}yPPV6%~1m=ypse4gj7f!E zAAE>aGbQ^`rPe&a?#npki~BZz!dC4INwDbc;$gSO7pwNclBwD%_hrxRq?49KMr*eA zX>Jv#@5edko<8^X?{~sqYir#Uw3UCHj*5FI>N_$po1@g(YJtup%0`{11nNE|(9dke zm1!zv3)sV^K6%om!PXJzJfcKunii;O8~oV?dfFk_?o-oF!49%YaDc29oFHAPsz9~w z{$)Z`)Tk_p_$@sgE^T5sw1XsnTjPe?41E(;muyS+j7^}^(9eK-@|?A0D9$h;LLehE zBucQusO&XG1stJQWccbYAf^I#-4&OWC<#Dkm9UIOE{^5JxT-sqxX3RA9J)ghW3#$@ zM&_}=Dbcj3GsS)~DyR{iEe;}LbS|PQBz*|l+s}F<@}k%qj_|Qq?;^htmFBo)RE=<9 zSrB^{li|MJgcMZ=dSSbHF|2ZPJgDC;CnFe7=`N0of)2-}8!A}}nv+i0O6db}kJ1hV zb1r|DS-z=x4m_oEp1{-7-}dEtPOr5LWgTDCYHjUV$GXd-HF>g*FWp;UM7@)061I`* zOCTRn8G4?mY-{sGV_Oqw!Dil!B^%h0sJ1o1{;YHyaCCNsPQk&=S8Y>*p>e#9C1-|u z?`qXjb;gmYS~x^e`1_1AQ!O~sU}=p13D?4A^!^SWT>tGKud9qXD>%zBxiYT#T64bg zd{*kt!xyr>nQKBZlFMqnsUcLGerd|Go6DSCs>#&+$lY#RcB?V{(v;xd`P2mFGz2GI z{Sj};8d>#P_N}$-Tes`Jtrn|2A8IAk!AEN%5tV@tdVZgo;mUL2Cfou9x;x(1;(LQ- zQ^msUW#~#IyL$Kkp!a6eXXR=2o}vJ9_J#mW2)4W;N_y2L5i7FvihLC5!OE9?3XNb9 zrQ`&{A}^$nDkDYZv5M4)hzL9kqZ>D__l9oWLT;VDp8mJh^qLrp5k={Up^g(VQ9(TT z;}tY3$6|6)2?m46jrxMOTCkn}csD$~r2=5eyp@xzSm`Yc#{d6l@D!Sqc|V!}9u-#Q4#a?liX3=}`Klb(@K9 z2xdk^5fRd#gd-tI>V|&#STRr@94x%YxwPMEdM(1MNRpGo=+Nb{D^nwvrvk_wVBz|x zkbT`gC#rfq2#%i4LDV`wYrQ&E@cP8R-5$n!49GZ%2h(aB& zEO56=G{g068}|p?m|&#tAomS7kZu*Yfa|JP7oT^{PD*D?KO(+s9i+gTjdLNhq6wszG5$0NTxwR+&|!+$!w>FZeQyjk$wT0W;W`yOR}oB92(H=28L%{_(Y zqt6@i&Br%ee6K00{a23fDayk;UZSqGgP{Vt^w_C+(aI-JKKW{B!yC+bg9Y!g=V$ZY z6Ps=RwT|C_wr|9y^$$KCU736`xth$k^=h8>m9{5sU+v%U9L;%-7CgPr2lAdl*kNt| z_4Sr%EjaMlvEqK>UOka->3K<}KU;4(Ynjfq^k}}0Wyc@fud67wetC4Gu`Acum1nxN zj_&N}!^sDe%gG$uuCaSJ*mmfwI@Z}PjoJGlnlIR{*G`H(hzYH|QzwuLfc$N>LJjqC zb%KewP$dvNFQYqnD>Vbpd!T&V8PDy6$1>DidM8_`1AxQBwo0idKpnxAD;AYpexnIh zO{V+^>EExMP0rbMM@*Rk6KwGHm0+{_Fyzu2&-)cjSJ@A6{X&zs8^oz;O zrq(rYq|mgGb!$x12II{!-U8#>U^;V5XMyQ@+K^|CY_j!h`!2j-LoZ3^%sM-)b#z)_ zYqQa_);d^dJdv%@n8t_04~7d&+XmB-V>$}Vfv5I7)1!49v>0ff{n^nkCk=PQ>+GjH zuKt8)aL(_xGFJSAXGUTKgJrg3;*NNBX`Iw|CQONd3Br3(tnZ{6L1Ii?gsP3e7{NU# zr=qeD4Fg)t!~ja%x|7Fqvh=agHfVviz>jgL3hx7ca)7Ka#EuM?9El(g2BxC#S82O5)q(y?KA%yq%ek1Ft(f zK4~;GK(co-7D*A=ju~jr&O7iF&Jo!sPB@r-J7i1&4)cGQ2!t%nh0wff@~E-5Twu{FfI6*4XS*|NulrDMAzxYL`)k_eTGYcwm8!sucOfY zX#9I=Vg*9C^i%2TblB;+DzO|2M`BgzUmcR>NH;NTr&rC=Gt$t-*=dff>cXMq;!-#i zOD-;_7Gp~*A)b_EvR7Xv63L}xh*R+tnzf3DQA!%7uIX9iCR9k-Tf#F^hU!n(V~HO~ zWq_)cLnrHhPh{pQAP+2wg5J{OBj|N8W%Rn{6eJteI( z@7kSz?|8FNa!(vsdJ4UF%9gtuN}09fd|96~USVBD)>US?{A`IGInY~b09XU~2>^zB z_+i@SDD+L0Z8IA;WRoqomR*y?ipgCxxyz=(T}8=s`M}&==$Zavo{@(~H}P$Hi{9~; z%$^zn%vWkOFxql~Y(QG57`UQ=D;qrdM9DCUwkdQ??dzux>x;2{{nc7G@Jzyj)>$I~ zbAj(bf9yvmDaF~bv<5kRA5t$tBf-~ipI5Y0{plx+NIeF!+LW1;JK4;wBOD{fk13Y$ vHe2e|ehxOf(DQC1{ib{?@!+Eep>du=i3U!K7BvNg@E2xfp!Wz^VH5NReBIll diff --git a/__pycache__/starfall.cpython-311.pyc b/__pycache__/starfall.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eabff965ed0bfa6505b31b62d72527e91b73c704 GIT binary patch literal 1305 zcmZux&1(};5PxsKnl_1zrfP#s#R19ejtb+1&dPj5EdWXylt{|vzzX2j13#w zgNG;{q7>SLhlo;@!p^3fU~ulLX~%yk-SXm%&QCxS|Qy=#gu`7&ezuUVni z=lA)_ziK+Uj{usy2d1N}!F#>8(aGEgqwSrC*Ak9bp4#EY9qzrui)G3~-Em>k3LBWQ zHHQ+{sOl{0l^u&%<>HL)gu`bsM=#pXb)w~U%VP)gy4M!T%mT4sluXnuIvR2MIH<&j z%jAkdy#iATx{)t<48LG_fhnahAB$Ofg>>(k8-b{Fha9f3{*tLJ5MD<0KzJQ`I?v#K z1jg^f@%MwT;&r+HJctf%M~|&)o6%Fv@vZ2{Msy@d9$miv>URBBeLfgWH14cEdOP`g zvA!52hQ22hP@jZ2ZD|P;BWHU9fotkJUK|0eMZ_a)t|_R-GgmNG zFi8Scrm##7Vhk5%tzk-GsRHU<%>>d96la~hhtZge&F>a#Qfhi;UdZMjj7*FYPYgh!2xJKWRTn0u delta 142 zcmZqS`p?OCnwOW00SGR=G|l|YIFaudqu9i&hD@s&Cv!2{b2C){p(Ic`g?VxaW4JI& z4O0qp6;Q)!CXgneILqXHjK-X-ez#bYQqwc@HveX1ViYR{$}}+C;1}+%>a6Oo>#UoR jeuZCcvMBQxMuEv(EbWX!lP9sH^71n3ePRF-MIajhZ8#+R diff --git a/questioner.py b/questioner.py index 354ac1b..99970c9 100644 --- a/questioner.py +++ b/questioner.py @@ -5,26 +5,112 @@ class Questioner: def __init__(self, board_size): board_width, board_height = board_size self.position = (board_width // 2, board_height // 2) - + self.score_prompt = 200 + self.speak = True + def play_turn(self,game): + score=game.state.get("score", 0) person = game.get_agent_by_name('Person') - if person: - personx, persony = person.position - questionerx, questionery = self.position - if personx == questionerx and persony == questionery +1: - 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") + if not person: + return + personx, persony = person.position + questionerx, questionery = self.position + if personx == questionerx and persony == questionery +1: + 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") - begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) - if begin.strip().upper() == "Y": - print("Questioner: Well then, good luck player! \n") - game.state["begin"] = True + begin = input("Questioner: Shall we begin? [[Y/N]] \n" ) + if begin.strip().upper() == "Y": + print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ") + game.state["begin"] = True + elif prompt.strip().upper() == "N": + print("Questioner: I'll be here when you're ready to restart. \n") + game.state["begin"] = False + else: + print("Questioner: What now? (RESTART) \n") + game.state["begin"] = False + self.speak = False + + + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_1(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_2(game) + if score >= self.score_prompt: + game.state["begin"] = False + self.ask_question_3(game) - elif prompt.strip().upper() == "N": - print("Questioner: I'll be here when you're ready. \n") - else: - print("Questioner: What now?) \n") + + + def ask_question_1(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + 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": + print("You may proceed. See you again once you reach 400 points!") + else: + print("HMPH! WRONG!! YOU HAVE TWO LIVES REMAINIG.") + game.state['lives'] = 2 + proceed_1 = input("Shall we continue? [[Y/N]]") + if proceed_1.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_2(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_2 = input("Here is the second question: \n What is the 18th element of the periodic table? \n" ) + if question_2.strip().lower() == "argon": + print("You may proceed. See you again once you reach 600 points!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_2 = input("Shall we continue? [[Y/N]]") + if proceed_2.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + def ask_question_3(self,game): + score=game.state.get("score") + if score >= self.score_prompt: + game.state["begin"] = False + self.score_prompt += 200 + self.speak = True + question_3 = input("Last question: \n Which country is home to Bosphorus? \n" ) + if question_3.strip().lower() == "turkey": + print("Correct!") + else: + print("HMPH! WRONG!! YOU HAVE ONE LIFE REMAINIG.") + game.state['lives'] = 1 + proceed_3 = input("Shall we continue? [[Y/N]]") + if proceed_3.strip().upper() == "Y": + game.state["begin"] = True + self.speak = False + else: + print("I don't take this as an answer... CONTINUE!") + game.state["begin"] = True + self.speak = False + + + diff --git a/starfall_game.py b/starfall_game.py index 8062f59..8117a49 100644 --- a/starfall_game.py +++ b/starfall_game.py @@ -7,5 +7,5 @@ board_size = (50, 30) player = Person(board_size) questioner = Questioner(board_size) spawner = StarfallSpawner() -game = Game([player, questioner, spawner], {"score": 0, "begin": False}, board_size=board_size) +game = Game([player, questioner, spawner], {"score": 0, "lives": 3, "begin": False}, board_size=board_size) game.play() diff --git a/starfall_spawner.py b/starfall_spawner.py index 0c55f93..449f543 100644 --- a/starfall_spawner.py +++ b/starfall_spawner.py @@ -5,7 +5,7 @@ class StarfallSpawner: display = False def play_turn(self, game): - if not game.state.get("begin"): + if not game.state.get("begin", True): return width, height = game.board_size game.state['score'] += 1 @@ -13,5 +13,6 @@ class StarfallSpawner: star = Star((randint(0, width - 1), 0)) game.add_agent(star) + def should_spawn_star(self, turn_number): return randint(0, 1000) < turn_number \ No newline at end of file