Generating test cases
Produce the test_cases.json for a problem: a JSON array of cases that follow the schema and rules
below.
Test case schema:
{
"category": "dev" | "main" | "extra",
"input": { "<param_name>":
Analyse the problem statement (file 'statement.html') carefully, then produce a JSON array of test cases that follow the schema above and the rules below.
-
devtest cases — Extract every worked example in the problem statement whose answer is stated explicitly. Use"category": "dev". -
maintest case — Extract the actual problem input (the one whose answer is being sought). Use"category": "main"and set"answer": null, since the problem is not yet solved. -
extratest cases — Add 1–2 cases with inputs larger thanmainto serve as benchmarks. Use"category": "extra"and set"answer": null. Size them so that a correct, efficient solution finishes within roughly 60 seconds; ifmainis already at the high end of what is reasonably solvable, skip theextracases. -
Input keys — Choose concise, snake_case key names that describe each parameter (e.g.
"limit","n","max_n","grid_size"). If the problem takes no variable input (a fixed puzzle), use"input": {}.A statement-linked data file is always passed as
file_url(its projecteuler.net URL), which the solution reads viaget_text_filefrom the locally cachedresources/copy. An emptyfile_url("") means use data embedded in the solution module as a variable instead of reading a file — common for a smalldevcase whose data is short enough to inline. The solution branches on it: a non-emptyfile_urlreads the resource; an empty one falls back to the embedded variable. -
Type consistency — The answer type must be identical across
dev,main, andextrafor the same problem. If thedevanswers are integers, thenmainandextrawill be integers once solved (so theirnullvalues should later be filled with integers); the same applies to strings and lists. Do not mix answer types across categories. -
Ordering — List the
devcases first, thenmain, then theextracases last.