Skip to content

Instantly share code, notes, and snippets.

View ji233-Sun's full-sized avatar
🤗
PvZ3C is Rubbish

ji233 ji233-Sun

🤗
PvZ3C is Rubbish
  • Singapore
  • 10:39 (UTC +08:00)
View GitHub Profile
@ji233-Sun
ji233-Sun / test.py
Created April 16, 2026 06:19
CW2测试
#!/usr/bin/env python3
"""COMP1039 8-puzzle 作业自动测试脚本。
用途概览
========
这个脚本用于批量测试 Haskell 文件中的 ``shortestPath :: [Int] -> [Int] -> (String, Int)``。
它不是只拿固定答案字符串做对比,而是会自己计算参考最短步数,然后检查被测程序是否满足:
1. 返回值格式必须是 ``(moves, length)``。
2. ``moves`` 只能包含 ``U``、``D``、``L``、``R``。