Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,8 @@ def ask_gemini(prompt, secret_word):
|
|
27 |
# Function to handle game logic
|
28 |
def jailbreak_game(user_prompt, current_level, attempts):
|
29 |
# Determine the secret word for the current level
|
30 |
-
|
31 |
-
|
32 |
|
33 |
secret_word = new_year_levels[current_level - 1]
|
34 |
ai_response = ask_gemini(user_prompt, secret_word)
|
@@ -52,7 +52,7 @@ def jailbreak_game(user_prompt, current_level, attempts):
|
|
52 |
return (
|
53 |
f"π You got it! The secret word for Level {current_level} was '{secret_word}'. "
|
54 |
"You have completed all levels!π₯³ Here is a unique New Year message for you: "
|
55 |
-
f"{NY_msg}", current_level, attempts + 1)
|
56 |
|
57 |
else:
|
58 |
return ai_response, current_level, attempts + 1
|
|
|
27 |
# Function to handle game logic
|
28 |
def jailbreak_game(user_prompt, current_level, attempts):
|
29 |
# Determine the secret word for the current level
|
30 |
+
if current_level > len(new_year_levels):
|
31 |
+
return ("Congratulations! π You have completed all levels. ", current_level, attempts)
|
32 |
|
33 |
secret_word = new_year_levels[current_level - 1]
|
34 |
ai_response = ask_gemini(user_prompt, secret_word)
|
|
|
52 |
return (
|
53 |
f"π You got it! The secret word for Level {current_level} was '{secret_word}'. "
|
54 |
"You have completed all levels!π₯³ Here is a unique New Year message for you: "
|
55 |
+
f"{NY_msg}", current_level + 1, attempts + 1)
|
56 |
|
57 |
else:
|
58 |
return ai_response, current_level, attempts + 1
|