This commit is contained in:
Nikolaj
2022-01-14 10:40:45 +01:00
parent 0ef63ca80b
commit bcffb44393
10 changed files with 16 additions and 11 deletions

View File

@ -1,19 +1,15 @@
import random
import time
import os
import pathlib
from font_game.images import gen_image
from font_game import base64, FONTS, read_file, write_file
from font_game import gen_id, FONTS, read_file, write_file
def purge_games():
for root, _, files in os.walk("current_games"):
for file in files:
os.remove(os.path.join(root, file))
def gen_id():
return base64(int(time.time()*10000))
def pick_fonts(game_length: int):
weights = {key: 100 for key in FONTS}
font_list = []
@ -32,7 +28,6 @@ def start_game(game_length: int = 10) -> str:
game_id = gen_id()
game_dict = {
"points": "0",
"i": "0",