Merlintxu commited on
Commit
5f43e64
·
1 Parent(s): 7b06130

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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
- return '¡Correcto!'
 
22
  else:
23
- return 'Incorrecto. Intenta de nuevo.'
 
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()