Aswini96 commited on
Commit
1d3053d
Β·
verified Β·
1 Parent(s): 79490cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,7 +27,7 @@ def ask_openai(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
- if current_level >= len(new_year_levels)+1:
31
  return ("Congratulations! πŸŽ‰ You have completed all levels. ", current_level, attempts)
32
 
33
  secret_word = new_year_levels[current_level]
@@ -35,7 +35,7 @@ def jailbreak_game(user_prompt, current_level, attempts):
35
 
36
  # Check if the secret word was revealed
37
  if secret_word in ai_response.lower():
38
- if current_level < len(new_year_levels):
39
  return (
40
  f"πŸŽ‰ You got it! The secret word for Level {current_level + 1} was '{secret_word}'. "
41
  f"Get ready for Level {current_level + 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)+ 1:
31
  return ("Congratulations! πŸŽ‰ You have completed all levels. ", current_level, attempts)
32
 
33
  secret_word = new_year_levels[current_level]
 
35
 
36
  # Check if the secret word was revealed
37
  if secret_word in ai_response.lower():
38
+ if current_level + 1 < len(new_year_levels):
39
  return (
40
  f"πŸŽ‰ You got it! The secret word for Level {current_level + 1} was '{secret_word}'. "
41
  f"Get ready for Level {current_level + 1}! πŸ₯³",