(file)
| 33 | } |
| 34 | |
| 35 | function readProblems(file) { |
| 36 | const source = fs.readFileSync(file, "utf8"); |
| 37 | const match = source.match(/window\.WS_PROBLEMS\s*=\s*([\s\S]*?);\s*$/); |
| 38 | if (!match) throw new Error(`Cannot find window.WS_PROBLEMS in ${file}`); |
| 39 | return JSON.parse(match[1]); |
| 40 | } |
| 41 | |
| 42 | function difficulty(value) { |
| 43 | if (value === "简单") return "easy"; |