shortdeck1.0

This commit is contained in:
2025-09-30 18:09:49 +08:00
commit ee95b8e049
24 changed files with 532 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
from __future__ import annotations
import json
from pathlib import Path
from typing import Any, Dict
DATA_DIR = Path(__file__).parent.joinpath("data")
DATA_DIR.mkdir(exist_ok=True)
def append_game_history(game_id, entry):
file = DATA_DIR / f"{game_id}.jsonl"
with file.open("a", encoding="utf-8") as f:
f.write(json.dumps(entry))
f.write("\n")