Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ def game_fn(sky=sky,star=star,bomb=bomb,platform=platform,dude=dude):
|
|
| 44 |
height="100%"
|
| 45 |
></iframe>
|
| 46 |
</div>"""
|
| 47 |
-
return gr.update(html_mod)
|
| 48 |
|
| 49 |
def update_game(inp):
|
| 50 |
return game_fn(sky=sky)
|
|
@@ -260,12 +260,9 @@ def get_high_score():
|
|
| 260 |
lod = json.loads(r.text)
|
| 261 |
high_score=[0,0,0]
|
| 262 |
sort_score=[0,0,0]
|
| 263 |
-
print(sort_score)
|
| 264 |
for ea in lod:
|
| 265 |
try:
|
| 266 |
-
print (ea)
|
| 267 |
-
print (ea['game_name'])
|
| 268 |
-
print (ea['score'])
|
| 269 |
if ea['score'] != "":
|
| 270 |
if int(ea['score']) >= int(sort_score[0]):
|
| 271 |
sort_score[2]=sort_score[1]
|
|
@@ -274,30 +271,21 @@ def get_high_score():
|
|
| 274 |
high_score[1]=high_score[0]
|
| 275 |
sort_score[0]=ea['score']
|
| 276 |
high_score[0]=(f"{ea['score']}<br>{ea['game_name']}<br><br>")
|
| 277 |
-
print(sort_score)
|
| 278 |
-
print(high_score)
|
| 279 |
pass
|
| 280 |
elif int(ea['score']) >= int(sort_score[1]):
|
| 281 |
sort_score[2]=sort_score[1]
|
| 282 |
high_score[2]=high_score[1]
|
| 283 |
sort_score[1]=ea['score']
|
| 284 |
high_score[1]=(f"{ea['score']}<br>{ea['game_name']}<br><br>")
|
| 285 |
-
print(sort_score)
|
| 286 |
-
print(high_score)
|
| 287 |
pass
|
| 288 |
elif int(ea['score']) >= int(sort_score[2]):
|
| 289 |
sort_score[2]=ea['score']
|
| 290 |
high_score[2]=(f"{ea['score']}<br>{ea['game_name']}<br><br>")
|
| 291 |
-
print(sort_score)
|
| 292 |
-
print(high_score)
|
| 293 |
pass
|
| 294 |
-
|
| 295 |
-
#high_score.sort()
|
| 296 |
except Exception as e:
|
| 297 |
print(e)
|
| 298 |
pass
|
| 299 |
return f"<h3><u>High Score</u></h3><br>{high_score[0]}<br>{high_score[1]}<br>{high_score[2]}<br>"
|
| 300 |
-
|
| 301 |
except Exception as e:
|
| 302 |
return e
|
| 303 |
|
|
|
|
| 44 |
height="100%"
|
| 45 |
></iframe>
|
| 46 |
</div>"""
|
| 47 |
+
return gr.update(f'{html_mod}')
|
| 48 |
|
| 49 |
def update_game(inp):
|
| 50 |
return game_fn(sky=sky)
|
|
|
|
| 260 |
lod = json.loads(r.text)
|
| 261 |
high_score=[0,0,0]
|
| 262 |
sort_score=[0,0,0]
|
| 263 |
+
#print(sort_score)
|
| 264 |
for ea in lod:
|
| 265 |
try:
|
|
|
|
|
|
|
|
|
|
| 266 |
if ea['score'] != "":
|
| 267 |
if int(ea['score']) >= int(sort_score[0]):
|
| 268 |
sort_score[2]=sort_score[1]
|
|
|
|
| 271 |
high_score[1]=high_score[0]
|
| 272 |
sort_score[0]=ea['score']
|
| 273 |
high_score[0]=(f"{ea['score']}<br>{ea['game_name']}<br><br>")
|
|
|
|
|
|
|
| 274 |
pass
|
| 275 |
elif int(ea['score']) >= int(sort_score[1]):
|
| 276 |
sort_score[2]=sort_score[1]
|
| 277 |
high_score[2]=high_score[1]
|
| 278 |
sort_score[1]=ea['score']
|
| 279 |
high_score[1]=(f"{ea['score']}<br>{ea['game_name']}<br><br>")
|
|
|
|
|
|
|
| 280 |
pass
|
| 281 |
elif int(ea['score']) >= int(sort_score[2]):
|
| 282 |
sort_score[2]=ea['score']
|
| 283 |
high_score[2]=(f"{ea['score']}<br>{ea['game_name']}<br><br>")
|
|
|
|
|
|
|
| 284 |
pass
|
|
|
|
|
|
|
| 285 |
except Exception as e:
|
| 286 |
print(e)
|
| 287 |
pass
|
| 288 |
return f"<h3><u>High Score</u></h3><br>{high_score[0]}<br>{high_score[1]}<br>{high_score[2]}<br>"
|
|
|
|
| 289 |
except Exception as e:
|
| 290 |
return e
|
| 291 |
|