Spaces:
Runtime error
Runtime error
JAYASWAROOP
commited on
Commit
•
f58dbe1
1
Parent(s):
098bfea
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import random as r
|
|
2 |
import gradio as gr
|
3 |
|
4 |
|
5 |
-
count = 0
|
6 |
def generate_number():
|
7 |
while True:
|
8 |
num = [r.randint(1, 9)] + [r.randint(0, 9) for _ in range(3)]
|
@@ -20,11 +19,8 @@ def play_game(user_guess):
|
|
20 |
bull = sum(g in secret_number and g != s for g, s in zip(guessed_number, secret_number))
|
21 |
|
22 |
if cow == 4:
|
23 |
-
|
24 |
-
count=0
|
25 |
-
return "Congratulations! You won the game. You completed this game in " + str(d) + "tries."
|
26 |
else:
|
27 |
-
count+=1
|
28 |
return f"Bulls: {bull}\nCows: {cow}\nEnter your next guess"
|
29 |
|
30 |
# Generate the secret number
|
|
|
2 |
import gradio as gr
|
3 |
|
4 |
|
|
|
5 |
def generate_number():
|
6 |
while True:
|
7 |
num = [r.randint(1, 9)] + [r.randint(0, 9) for _ in range(3)]
|
|
|
19 |
bull = sum(g in secret_number and g != s for g, s in zip(guessed_number, secret_number))
|
20 |
|
21 |
if cow == 4:
|
22 |
+
return "Congratulations! You won the game."
|
|
|
|
|
23 |
else:
|
|
|
24 |
return f"Bulls: {bull}\nCows: {cow}\nEnter your next guess"
|
25 |
|
26 |
# Generate the secret number
|