Update app.py
Browse files
app.py
CHANGED
|
@@ -2,20 +2,19 @@ import gradio as gr
|
|
| 2 |
import random as rd
|
| 3 |
|
| 4 |
rand = rd.randint(0,9)
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
def guess(num):
|
| 7 |
num = int(num)
|
| 8 |
if num == rand:
|
| 9 |
r = 'ทายถูกแล้ว'
|
| 10 |
else:
|
| 11 |
r = 'ลองกดใหม่นะ'
|
| 12 |
-
return r
|
| 13 |
-
|
| 14 |
def answer():
|
| 15 |
return str(rand)
|
| 16 |
-
|
| 17 |
-
self.rand = rd.randint(0,9)
|
| 18 |
-
return ''
|
| 19 |
with gr.Blocks() as myApp:
|
| 20 |
with gr.Row():
|
| 21 |
with gr.Column(scale=1):
|
|
|
|
| 2 |
import random as rd
|
| 3 |
|
| 4 |
rand = rd.randint(0,9)
|
| 5 |
+
def newRand():
|
| 6 |
+
rand = rd.randint(0,9)
|
| 7 |
+
return ''
|
| 8 |
def guess(num):
|
| 9 |
num = int(num)
|
| 10 |
if num == rand:
|
| 11 |
r = 'ทายถูกแล้ว'
|
| 12 |
else:
|
| 13 |
r = 'ลองกดใหม่นะ'
|
| 14 |
+
return r
|
|
|
|
| 15 |
def answer():
|
| 16 |
return str(rand)
|
| 17 |
+
|
|
|
|
|
|
|
| 18 |
with gr.Blocks() as myApp:
|
| 19 |
with gr.Row():
|
| 20 |
with gr.Column(scale=1):
|