1979/run_playtest.py

run_playtest.py

run_playtest.py · 0.8 KB

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""试玩运行脚本 - 运行自动试玩并生成报告"""

import sys
import os

# 修复 Windows 终端编码(UTF-8 输出)
if sys.platform == 'win32':
    try:
        sys.stdout.reconfigure(encoding='utf-8')
        sys.stderr.reconfigure(encoding='utf-8')
    except Exception:
        pass

sys.path.insert(0, 'D:/1979')

from src.playtest import AutoPlaytest


def main():
    """运行试玩"""
    num_runs = 20  # 默认20次运行

    if len(sys.argv) > 1:
        num_runs = int(sys.argv[1])

    tester = AutoPlaytest()
    report = tester.run_full_playtest(num_runs)

    print(report)

    # 保存报告
    with open('playtest_report.txt', 'w', encoding='utf-8') as f:
        f.write(report)

    print("\n报告已保存到 playtest_report.txt")


if __name__ == '__main__':
    main()

← 返回文件树 · 在 GitHub 上查看