generated from mwc/project_game
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!!
This commit is contained in:
68
.history/questioner_20251212220508.py
Normal file
68
.history/questioner_20251212220508.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
68
.history/questioner_20251212222328.py
Normal file
68
.history/questioner_20251212222328.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
68
.history/questioner_20251212222330.py
Normal file
68
.history/questioner_20251212222330.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
67
.history/questioner_20251212222541.py
Normal file
67
.history/questioner_20251212222541.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
67
.history/questioner_20251212222542.py
Normal file
67
.history/questioner_20251212222542.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
67
.history/questioner_20251212222621.py
Normal file
67
.history/questioner_20251212222621.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
67
.history/questioner_20251212222622.py
Normal file
67
.history/questioner_20251212222622.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
67
.history/questioner_20251212222650.py
Normal file
67
.history/questioner_20251212222650.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
67
.history/questioner_20251212222651.py
Normal file
67
.history/questioner_20251212222651.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
68
.history/questioner_20251212223407.py
Normal file
68
.history/questioner_20251212223407.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
68
.history/questioner_20251212223408.py
Normal file
68
.history/questioner_20251212223408.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
68
.history/questioner_20251212223557.py
Normal file
68
.history/questioner_20251212223557.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
68
.history/questioner_20251212223558.py
Normal file
68
.history/questioner_20251212223558.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
70
.history/questioner_20251212223835.py
Normal file
70
.history/questioner_20251212223835.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
70
.history/questioner_20251212223836.py
Normal file
70
.history/questioner_20251212223836.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
70
.history/questioner_20251212224035.py
Normal file
70
.history/questioner_20251212224035.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
70
.history/questioner_20251212224036.py
Normal file
70
.history/questioner_20251212224036.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
90
.history/questioner_20251212224418.py
Normal file
90
.history/questioner_20251212224418.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
90
.history/questioner_20251212224419.py
Normal file
90
.history/questioner_20251212224419.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
93
.history/questioner_20251212224437.py
Normal file
93
.history/questioner_20251212224437.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
93
.history/questioner_20251212224438.py
Normal file
93
.history/questioner_20251212224438.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
93
.history/questioner_20251212224638.py
Normal file
93
.history/questioner_20251212224638.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
93
.history/questioner_20251212224639.py
Normal file
93
.history/questioner_20251212224639.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
116
.history/questioner_20251212225454.py
Normal file
116
.history/questioner_20251212225454.py
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
.history/starfall_game_20251212211111.py
Normal file
11
.history/starfall_game_20251212211111.py
Normal file
@@ -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()
|
||||||
11
.history/starfall_game_20251212225458.py
Normal file
11
.history/starfall_game_20251212225458.py
Normal file
@@ -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()
|
||||||
18
.history/starfall_spawner_20251212220756.py
Normal file
18
.history/starfall_spawner_20251212220756.py
Normal file
@@ -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
|
||||||
18
.history/starfall_spawner_20251212222744.py
Normal file
18
.history/starfall_spawner_20251212222744.py
Normal file
@@ -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
|
||||||
Binary file not shown.
Binary file not shown.
BIN
__pycache__/starfall.cpython-311.pyc
Normal file
BIN
__pycache__/starfall.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
118
questioner.py
118
questioner.py
@@ -5,26 +5,112 @@ class Questioner:
|
|||||||
def __init__(self, board_size):
|
def __init__(self, board_size):
|
||||||
board_width, board_height = board_size
|
board_width, board_height = board_size
|
||||||
self.position = (board_width // 2, board_height // 2)
|
self.position = (board_width // 2, board_height // 2)
|
||||||
|
self.score_prompt = 200
|
||||||
|
self.speak = True
|
||||||
|
|
||||||
def play_turn(self,game):
|
def play_turn(self,game):
|
||||||
|
score=game.state.get("score", 0)
|
||||||
person = game.get_agent_by_name('Person')
|
person = game.get_agent_by_name('Person')
|
||||||
if person:
|
if not person:
|
||||||
personx, persony = person.position
|
return
|
||||||
questionerx, questionery = self.position
|
personx, persony = person.position
|
||||||
if personx == questionerx and persony == questionery +1:
|
questionerx, questionery = self.position
|
||||||
prompt = input("Questioner: Are you ready to start the game? [[Y/N]] \n")
|
if personx == questionerx and persony == questionery +1:
|
||||||
if prompt.strip().upper() == "Y":
|
if score == 0 and self.speak:
|
||||||
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")
|
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" )
|
begin = input("Questioner: Shall we begin? [[Y/N]] \n" )
|
||||||
if begin.strip().upper() == "Y":
|
if begin.strip().upper() == "Y":
|
||||||
print("Questioner: Well then, good luck player! \n")
|
print("Questioner: Well then, good luck player \n Come back to me once you accumulate 200 points! ")
|
||||||
game.state["begin"] = True
|
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:
|
def ask_question_1(self,game):
|
||||||
print("Questioner: What now?) \n")
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ board_size = (50, 30)
|
|||||||
player = Person(board_size)
|
player = Person(board_size)
|
||||||
questioner = Questioner(board_size)
|
questioner = Questioner(board_size)
|
||||||
spawner = StarfallSpawner()
|
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()
|
game.play()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class StarfallSpawner:
|
|||||||
display = False
|
display = False
|
||||||
|
|
||||||
def play_turn(self, game):
|
def play_turn(self, game):
|
||||||
if not game.state.get("begin"):
|
if not game.state.get("begin", True):
|
||||||
return
|
return
|
||||||
width, height = game.board_size
|
width, height = game.board_size
|
||||||
game.state['score'] += 1
|
game.state['score'] += 1
|
||||||
@@ -13,5 +13,6 @@ class StarfallSpawner:
|
|||||||
star = Star((randint(0, width - 1), 0))
|
star = Star((randint(0, width - 1), 0))
|
||||||
game.add_agent(star)
|
game.add_agent(star)
|
||||||
|
|
||||||
|
|
||||||
def should_spawn_star(self, turn_number):
|
def should_spawn_star(self, turn_number):
|
||||||
return randint(0, 1000) < turn_number
|
return randint(0, 1000) < turn_number
|
||||||
Reference in New Issue
Block a user