Spaces:
Sleeping
Sleeping
smhavens
commited on
Commit
•
a32aae4
1
Parent(s):
052d58f
Bug Fix: Indexing error when first guess was right and better guess formatting
Browse files
app.py
CHANGED
@@ -219,14 +219,14 @@ def check_answer(guess:str):
|
|
219 |
# print("IS", protected_guess, "EQUAL TO", answer, ":", protected_guess.lower() == answer.lower())
|
220 |
|
221 |
if protected_guess.lower() == answer.lower():
|
222 |
-
return_guesses
|
223 |
-
output += f"
|
224 |
new_prompt = generate_prompt(model)
|
225 |
return new_prompt, "Correct!", output
|
226 |
else:
|
227 |
return_guess = f"{guess}: {word1} is to {word2} as {other_word} is to {protected_guess}."
|
228 |
return_guesses.append(return_guess)
|
229 |
-
output += return_guess
|
230 |
return prompt, "Try again!", output
|
231 |
|
232 |
def main():
|
|
|
219 |
# print("IS", protected_guess, "EQUAL TO", answer, ":", protected_guess.lower() == answer.lower())
|
220 |
|
221 |
if protected_guess.lower() == answer.lower():
|
222 |
+
return_guesses.append(f"{word1} is to {word2} as {word3} is to {protected_guess}.")
|
223 |
+
output += f"<span style='color:green'>- {return_guesses[-1]}</span><br>"
|
224 |
new_prompt = generate_prompt(model)
|
225 |
return new_prompt, "Correct!", output
|
226 |
else:
|
227 |
return_guess = f"{guess}: {word1} is to {word2} as {other_word} is to {protected_guess}."
|
228 |
return_guesses.append(return_guess)
|
229 |
+
output += ("- " + return_guess + " <br>")
|
230 |
return prompt, "Try again!", output
|
231 |
|
232 |
def main():
|