Update app.py
Browse files
app.py
CHANGED
|
@@ -16,11 +16,15 @@ def game_logic(sentence, user_input):
|
|
| 16 |
return False
|
| 17 |
|
| 18 |
def main(sentence, user_input):
|
|
|
|
|
|
|
| 19 |
if sentence and user_input:
|
| 20 |
if game_logic(sentence, user_input):
|
| 21 |
-
|
|
|
|
| 22 |
else:
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
iface = gr.Interface(fn=main, inputs=["text", "text"], outputs="text")
|
| 26 |
iface.launch()
|
|
|
|
| 16 |
return False
|
| 17 |
|
| 18 |
def main(sentence, user_input):
|
| 19 |
+
score = 0
|
| 20 |
+
feedback = ''
|
| 21 |
if sentence and user_input:
|
| 22 |
if game_logic(sentence, user_input):
|
| 23 |
+
score += 1
|
| 24 |
+
feedback = '¡Correcto! Tu puntuación es: ' + str(score)
|
| 25 |
else:
|
| 26 |
+
feedback = 'Incorrecto. Intenta de nuevo.'
|
| 27 |
+
return feedback
|
| 28 |
|
| 29 |
iface = gr.Interface(fn=main, inputs=["text", "text"], outputs="text")
|
| 30 |
iface.launch()
|