This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """COMP1039 8-puzzle 作业自动测试脚本。 | |
| 用途概览 | |
| ======== | |
| 这个脚本用于批量测试 Haskell 文件中的 ``shortestPath :: [Int] -> [Int] -> (String, Int)``。 | |
| 它不是只拿固定答案字符串做对比,而是会自己计算参考最短步数,然后检查被测程序是否满足: | |
| 1. 返回值格式必须是 ``(moves, length)``。 | |
| 2. ``moves`` 只能包含 ``U``、``D``、``L``、``R``。 |