Alexis Palmer
commited on
Commit
·
36bb725
1
Parent(s):
b4cc7bf
minor changes
Browse files
app.py
CHANGED
@@ -56,9 +56,9 @@ def scrambler_game(current_word, guess: str):
|
|
56 |
"""
|
57 |
if guess == current_word['original']:
|
58 |
current_word = random_scramble(filtered_lexicon)
|
59 |
-
return ('
|
60 |
else:
|
61 |
-
return ('
|
62 |
|
63 |
|
64 |
def new_word():
|
@@ -66,21 +66,21 @@ def new_word():
|
|
66 |
return ('', current_word['shuffled'], current_word)
|
67 |
|
68 |
|
69 |
-
with gr.Blocks(theme=gr.themes.Soft(), title="
|
70 |
# Start with some initial word
|
71 |
current_word = gr.State(random_scramble(filtered_lexicon))
|
72 |
|
73 |
-
gr.Markdown("#
|
74 |
|
75 |
# Notice how we set the initial value based on the State
|
76 |
-
scrambled_textbox = gr.Textbox(label="
|
77 |
|
78 |
-
guess_textbox = gr.Textbox(label="
|
79 |
-
guess_button = gr.Button(value="
|
80 |
|
81 |
-
new_word_button = gr.Button(value="
|
82 |
|
83 |
-
output_textbox = gr.Textbox(label="
|
84 |
|
85 |
guess_button.click(fn=scrambler_game, inputs=[current_word, guess_textbox], outputs=[output_textbox, scrambled_textbox, current_word])
|
86 |
new_word_button.click(fn=new_word, inputs=[], outputs=[output_textbox, scrambled_textbox, current_word])
|
|
|
56 |
"""
|
57 |
if guess == current_word['original']:
|
58 |
current_word = random_scramble(filtered_lexicon)
|
59 |
+
return ('😀 ¡Correcto! 😀', current_word['shuffled'], current_word)
|
60 |
else:
|
61 |
+
return ('Incorrecto 😕', current_word['shuffled'], current_word)
|
62 |
|
63 |
|
64 |
def new_word():
|
|
|
66 |
return ('', current_word['shuffled'], current_word)
|
67 |
|
68 |
|
69 |
+
with gr.Blocks(theme=gr.themes.Soft(), title="Inan Nemül") as unscramble:
|
70 |
# Start with some initial word
|
71 |
current_word = gr.State(random_scramble(filtered_lexicon))
|
72 |
|
73 |
+
gr.Markdown("# Inan Nemül")
|
74 |
|
75 |
# Notice how we set the initial value based on the State
|
76 |
+
scrambled_textbox = gr.Textbox(label="Crucigrama", interactive=False, value=current_word.value['shuffled'])
|
77 |
|
78 |
+
guess_textbox = gr.Textbox(label="Adivinar - Adivina la palabra y luego aprieta en 'enviar'")
|
79 |
+
guess_button = gr.Button(value="Enviar")
|
80 |
|
81 |
+
new_word_button = gr.Button(value="Nueva Palabra")
|
82 |
|
83 |
+
output_textbox = gr.Textbox(label="Resultado", interactive=False)
|
84 |
|
85 |
guess_button.click(fn=scrambler_game, inputs=[current_word, guess_textbox], outputs=[output_textbox, scrambled_textbox, current_word])
|
86 |
new_word_button.click(fn=new_word, inputs=[], outputs=[output_textbox, scrambled_textbox, current_word])
|