tetris-final / scripts /check_seeds.py
Lishika's picture
Tetris OpenEnv - complete project with dashboard
c315b66
Raw
History Blame Contribute Delete
631 Bytes
import json, os
for step in [0, 50, 100]:
turns_list, lines_list, sizes = [], [], []
for seed in [42, 123, 777]:
fname = f"replays/seed_step{step}_seed{seed}.json"
size_kb = os.path.getsize(fname) // 1024
with open(fname) as f:
d = json.load(f)
turns_list.append(d["total_turns"])
lines_list.append(d["total_lines"])
sizes.append(size_kb)
print(f" {fname}: {size_kb}KB, turns={d['total_turns']}, lines={d['total_lines']}")
print(f" Step {step} AVG: turns={sum(turns_list)/3:.1f}, lines={sum(lines_list)/3:.1f}, max_size={max(sizes)}KB")
print()