Update app.py
Browse files
app.py
CHANGED
|
@@ -71,13 +71,22 @@ game_state = {
|
|
| 71 |
"safe_spots": [5, 10],
|
| 72 |
"help_lines_used": {"50:50": False, "Skip": False, "Clue": False}
|
| 73 |
}
|
| 74 |
-
|
| 75 |
def get_next_question():
|
|
|
|
| 76 |
if game_state["current_question"] < len(question_bank):
|
|
|
|
| 77 |
return question_bank[game_state["current_question"]]
|
| 78 |
else:
|
|
|
|
| 79 |
return {"question": "Congratulations, you've won!", "options": [], "answer": ""}
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
def check_answer(answer):
|
| 82 |
if answer == question_bank[game_state["current_question"]]["answer"]:
|
| 83 |
game_state["score"] += 1
|
|
|
|
| 71 |
"safe_spots": [5, 10],
|
| 72 |
"help_lines_used": {"50:50": False, "Skip": False, "Clue": False}
|
| 73 |
}
|
|
|
|
| 74 |
def get_next_question():
|
| 75 |
+
print("Getting next question...")
|
| 76 |
if game_state["current_question"] < len(question_bank):
|
| 77 |
+
print("Returning question:", question_bank[game_state["current_question"]])
|
| 78 |
return question_bank[game_state["current_question"]]
|
| 79 |
else:
|
| 80 |
+
print("Returning congratulations message.")
|
| 81 |
return {"question": "Congratulations, you've won!", "options": [], "answer": ""}
|
| 82 |
|
| 83 |
+
def update_game_state():
|
| 84 |
+
print("Updating game state...")
|
| 85 |
+
game_state["current_question"] += 1
|
| 86 |
+
print("Loading next question...")
|
| 87 |
+
return get_next_question()
|
| 88 |
+
|
| 89 |
+
|
| 90 |
def check_answer(answer):
|
| 91 |
if answer == question_bank[game_state["current_question"]]["answer"]:
|
| 92 |
game_state["score"] += 1
|