Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
17
26
language
stringclasses
9 values
difficulty
stringclasses
3 values
category
stringclasses
7 values
prompt
stringlengths
66
215
output_format
stringclasses
20 values
entry_point
stringclasses
4 values
reference_solution
null
tests
stringlengths
2
79
timeout_seconds
int64
3
3
metadata
stringlengths
175
559
smolscript-python-0015
python
easy
arithmetic_conditions
In Python, Starting with n, double it, then take the last decimal digit of its absolute value. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":6,"input":3},{"expected":4,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"ade7b55151527a3deee5ca1434bee8d379e3bb237dd779de03319398cf7fce4a"}
smolscript-python-0023
python
easy
arithmetic_conditions
In Python, Starting with n, square it, then take the last decimal digit of its absolute value. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":9,"input":3},{"expected":4,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"b77bdd39b0553f526671ee88201955e79d87b6494819f6c00c76ab30e324217e"}
smolscript-python-0024
python
easy
strings
In Python, Starting with ASCII string s, remove vowels aeiou in either case, then swap the case of ASCII letters. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"hLL","input":"Hello"},{"expected":" cD ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"0d95f52f5088fefd4f8c192de3db4a6065ef8dd61fbf5d795f65800b9e89ebc6"}
smolscript-python-0025
python
easy
arithmetic_conditions
In Python, Starting with n, take the last decimal digit of its absolute value, then negate it. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":-3,"input":3},{"expected":-2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"07ddda8434ac5983b5a6c0b67c87a8da516445cf349889e927de0268c1dedc9a"}
smolscript-python-0028
python
easy
strings
In Python, Starting with ASCII string s, keep the first floor(length/2) characters, then keep only ASCII letters. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"He","input":"Hello"},{"expected":"C","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"0ccf8a670ac5e4c470cf7c7e01028d21926f080204e605498a42f4b9e2e0517a"}
smolscript-python-0033
python
easy
arithmetic_conditions
In Python, Starting with n, negate it, then replace it with -1, 0, or 1 according to its sign. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":-1,"input":3},{"expected":1,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"9bbed522c596aca42bc66c8aa1f0af146d6f9c1513f011173cb38803ea95277c"}
smolscript-python-0038
python
easy
strings
In Python, Starting with ASCII string s, convert lowercase ASCII letters to uppercase, then keep only decimal digits. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"","input":"Hello"},{"expected":"","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"218a84dbeae54517f8506fe1b254e103c9b6db0e1929fd0ebf0e2d7c7f1394f4"}
smolscript-python-0041
python
easy
arithmetic_conditions
In Python, Starting with n, replace negative values with zero, then take the last decimal digit of its absolute value. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":3,"input":3},{"expected":0,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"7557df22757920b1370cd2d746458d631f38d05996a8d72a92c28422d0cf0b90"}
smolscript-python-0054
python
easy
strings
In Python, Starting with ASCII string s, keep the first floor(length/2) characters, then remove vowels aeiou in either case. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"H","input":"Hello"},{"expected":" C","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"ccc0fa988c623cda4908f86f653c6376bde36ae1930cd4319dad76c89deeb71e"}
smolscript-python-0056
python
easy
strings
In Python, Starting with ASCII string s, keep the first floor(length/2) characters, then keep characters from index floor(length/2) onward. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"e","input":"Hello"},{"expected":" C","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"480bcb355f50cb4c57c84eaf826c62f1dcc1c6460e896c8072939cd2a431f389"}
smolscript-python-0068
python
easy
strings
In Python, Starting with ASCII string s, convert lowercase ASCII letters to uppercase, then replace each run of spaces with one space. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"HELLO","input":"Hello"},{"expected":" CODE ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"3749d01f065413cf384d701c668109228e967352ca115233b801d988d77f8cd1"}
smolscript-python-0069
python
easy
arithmetic_conditions
In Python, Starting with n, replace it with 1 if even, otherwise 0, then subtract it from ten. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":10,"input":3},{"expected":9,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"81f7c3bf02fa7312be2dfa73953f89d6a6a642505bcb65bc7d73c4205c68f81f"}
smolscript-python-0075
python
easy
arithmetic_conditions
In Python, Starting with n, subtract it from ten, then clamp it to the inclusive range -5 to 5. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":5,"input":3},{"expected":5,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"43cd9321b89b1aa77cf6354f75dc2282eff3119666883e76907ddc8f84bb5d17"}
smolscript-python-0076
python
easy
strings
In Python, Starting with ASCII string s, keep characters from index floor(length/2) onward, then keep only ASCII letters. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"llo","input":"Hello"},{"expected":"ode","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"2a9046e7cb741792703a089c5b76b636228749b6785a4b0ecb3ff0fcb23ff042"}
smolscript-python-0082
python
easy
strings
In Python, Starting with ASCII string s, remove leading and trailing spaces, then keep the first floor(length/2) characters. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"He","input":"Hello"},{"expected":"Co","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"430ffa41c7f56109785a7de23d8020e88c92be5608727580a734671b4e508c2a"}
smolscript-python-0098
python
easy
strings
In Python, Starting with ASCII string s, keep only ASCII letters, then keep only decimal digits. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"","input":"Hello"},{"expected":"","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"ffc1dec30a21e634f9ccf70156331bd52f21220b955f42f2f032634c597deca1"}
smolscript-python-0101
python
easy
arithmetic_conditions
In Python, Starting with n, replace it with 1 if negative, otherwise 0, then double it. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":0,"input":3},{"expected":2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"73a609df81776070227a30f0bc78bbdb2c739728f1ff7f43f29ada82f759c05a"}
smolscript-python-0107
python
easy
arithmetic_conditions
In Python, Starting with n, take the tens digit of its absolute value, then replace it with -1, 0, or 1 according to its sign. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":0,"input":3},{"expected":0,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"3ca1fdde7f6a21e4364bf1f85bc0bed67e32b154d6c427f187196158f230e06f"}
smolscript-python-0108
python
easy
strings
In Python, Starting with ASCII string s, keep the first floor(length/2) characters, then remove leading and trailing spaces. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"He","input":"Hello"},{"expected":"C","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"d0fe6923b7cbbe3ec508fa7ee1adaa7d8c9154e032220744a9704f9b9ad424e5"}
smolscript-python-0113
python
easy
arithmetic_conditions
In Python, Starting with n, clamp it to the inclusive range -5 to 5, then clamp it to the inclusive range -5 to 5. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":3,"input":3},{"expected":-2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"503f50fc6029dfb81c0fc3a51b54fe4565d3d6519ffc96331d93b38831befd33"}
smolscript-python-0114
python
easy
strings
In Python, Starting with ASCII string s, convert uppercase ASCII letters to lowercase, then remove every space. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"hello","input":"Hello"},{"expected":"code","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"7fd4f345cddab601e1593c22922d6d8e1529881e51e026ed877e29d16abcf954"}
smolscript-python-0131
python
easy
arithmetic_conditions
In Python, Starting with n, take its absolute value, then negate it. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":-3,"input":3},{"expected":-2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"2e87ded0393ebf5467e8f166d370b3a13d64e2922587427de7e93e828ea8dedc"}
smolscript-python-0134
python
easy
strings
In Python, Starting with ASCII string s, keep characters from index floor(length/2) onward, then keep characters from index floor(length/2) onward. Return the result.
Return only the function def solve(s: str) -> str:. Do not include a main program.
solve
null
[{"expected":"lo","input":"Hello"},{"expected":"e ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"e4743c0d060cd8601652e269282204bff11ffa4d199d18276d770ec2bf48b28c"}
smolscript-python-0135
python
easy
arithmetic_conditions
In Python, Starting with n, subtract it from ten, then take the last decimal digit of its absolute value. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":7,"input":3},{"expected":2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"16c9cd1bf71a9676211614dc2a6d48d9461a10bb4f0631b8ccd28aec1edd016d"}
smolscript-python-0141
python
easy
arithmetic_conditions
In Python, Starting with n, clamp it to the inclusive range -5 to 5, then square it. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":9,"input":3},{"expected":4,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"a31b972bf1014a3518692605ad00fa6e34b404b88618073897b02cb7abc0949d"}
smolscript-python-0149
python
easy
arithmetic_conditions
In Python, Starting with n, subtract it from ten, then negate it. Return the result.
Return only the function def solve(n: int) -> int:. Do not include a main program.
solve
null
[{"expected":-7,"input":3},{"expected":-12,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"fb14e2b0c1137f95614874f05cf40fac1316cf99de85a85bad920aba89bc0a85"}
smolscript-python-0153
python
medium
collections_loops
In Python, Select items at odd zero-based indices from values in original order. Return their last value. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"78ccaeffcfcd1390bf6fc35b5de737c68e7996b2418298a555ca096e8ae741db"}
smolscript-python-0160
python
medium
collections_loops
In Python, Select nonzero items from values in original order. Return their count.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":3,"input":[1,2,3]},{"expected":2,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"5795ba18d9c352b3ff5f359d5207c4d2db5273d93e83dbee9fe730a0a65723e7"}
smolscript-python-0174
python
medium
collections_loops
In Python, Select negative items from values in original order. Return their minimum. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":0,"input":[1,2,3]},{"expected":-2,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"aca942244b229e6116e03151ae7b0c7dc2c751541ded11ac5fab6660280cb7cb"}
smolscript-python-0176
python
medium
collections_loops
In Python, Select items at odd zero-based indices from values in original order. Return their number of distinct values.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":1,"input":[1,2,3]},{"expected":1,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"61b49dd4a5f152f66623eae3169aebebd3834749c679fc2806a5efee3cc892ed"}
smolscript-python-0177
python
medium
collections_loops
In Python, Select odd items from values in original order. Return their count.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"cc21e21b31751e7ce9b2f0e58985ef579f9a9f55587805c06f6bb6c2197a54ca"}
smolscript-python-0183
python
medium
frequency_tables
In Python, Select items at odd zero-based indices from values in original order. Return their largest frequency of a value.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":1,"input":[1,2,3]},{"expected":1,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"96ecc563a3584cd4d5eeaf7f89f323615da9907a3a2fc5cf8591967cdce01193"}
smolscript-python-0184
python
medium
collections_loops
In Python, Select even items from values in original order. Return their last value. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":2,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"05f6b33b0652652ac924c504d5400a6640432aea69496667c54e3aa19cd3dc1e"}
smolscript-python-0188
python
medium
collections_loops
In Python, Select items at odd zero-based indices from values in original order. Return their sum.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"f437c8993c06242e214012b3399712402c921df3413b8fcc512dd5c9a2780b1c"}
smolscript-python-0194
python
medium
collections_loops
In Python, Select items with absolute value greater than three from values in original order. Return their number of distinct values.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":0,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"7a6b74dc469888abf098fd491b72a21ec161b590a03dd45c655e6451877e834c"}
smolscript-python-0209
python
medium
collections_loops
In Python, Select positive items from values in original order. Return their maximum. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":3,"input":[1,2,3]},{"expected":2,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"46dcbed0fee0e641638a90742e0cfe6a6d58b613b577fe58644d751b5471cf28"}
smolscript-python-0213
python
medium
collections_loops
In Python, Select nonzero items from values in original order. Return their maximum. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":3,"input":[1,2,3]},{"expected":2,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"053eebb9d6b4756bb9f4208b9bed3718c42e493856dd532d2d9c4c98a32a5939"}
smolscript-python-0219
python
medium
collections_loops
In Python, Select items with absolute value greater than three from values in original order. Return their sum.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":0,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"a02da41d0bc3b6898cf528607d4186fa97164a3185e8c82451d5c3755a625106"}
smolscript-python-0222
python
medium
collections_loops
In Python, Select even items from values in original order. Return their number of distinct values.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":1,"input":[1,2,3]},{"expected":3,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"bb12e9352008efbb8bf227bb894b2b401b693ad7c0057ac7bc05b934a5a6a3bb"}
smolscript-python-0226
python
moderate
collections_loops
In Python, Select items at odd zero-based indices from values in original order. For each selected item, double it. Return their maximum minus minimum. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":0,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"85c9c0d5316b01f6e69ea5a711697bc201f89aec76f437c0833a1564d8c4e028"}
smolscript-python-0229
python
moderate
frequency_tables
In Python, Select odd items from values in original order. For each selected item, take its absolute value. Return their largest frequency of a value.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":1,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"158d312c4c7ead897ef95ed09e4bbab735a99faf342197b64e62c720f8309f92"}
smolscript-python-0236
python
moderate
collections_loops
In Python, Select positive items from values in original order. For each selected item, square it. Return their first value. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":1,"input":[1,2,3]},{"expected":4,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"97644ff51265013b810abe08d4dd141473cb6cb05daf458dcb176294ebe6a218"}
smolscript-python-0237
python
moderate
collections_loops
In Python, Select all items from values in original order. For each selected item, replace it with -1, 0, or 1 according to its sign. Return their maximum. Return 0 when none are selected.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":1,"input":[1,2,3]},{"expected":1,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"7855867b78c8421e299b7eaa78f023d5998cf9f7ff94b505c02342acfa61116a"}
smolscript-python-0238
python
moderate
collections_loops
In Python, Select items at even zero-based indices from values in original order. For each selected item, negate it. Return their sum.
Return only the function def solve(values: list[int]) -> int:. Do not include a main program.
solve
null
[{"expected":-4,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"aa22d5ce24befd134488633bd13f5fd67ceaa5a1ec7f49a6e1f66fc2bcd46f47"}
smolscript-javascript-0010
javascript
easy
strings
In JavaScript, Starting with ASCII string s, replace each run of spaces with one space, then keep the first floor(length/2) characters. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"He","input":"Hello"},{"expected":" Co","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"04fce02d3df37668b5ee9fabc2d0441dc7a0eb557350bd486baf253231362acc"}
smolscript-javascript-0012
javascript
easy
strings
In JavaScript, Starting with ASCII string s, convert lowercase ASCII letters to uppercase, then reverse the characters. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"OLLEH","input":"Hello"},{"expected":" EDOC ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"10069624bbc5e4e1a58db9892ea51959ae2c1942957071fd44543ea745a266a8"}
smolscript-javascript-0014
javascript
easy
strings
In JavaScript, Starting with ASCII string s, keep characters from index floor(length/2) onward, then remove vowels aeiou in either case. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"ll","input":"Hello"},{"expected":"d ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"d3aea9cc9e4a27c3e9bac6582ec1b9f9405e860b2a5062e845937c1d8909d0f6"}
smolscript-javascript-0015
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, double it, then take the last decimal digit of its absolute value. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":6,"input":3},{"expected":4,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"ade7b55151527a3deee5ca1434bee8d379e3bb237dd779de03319398cf7fce4a"}
smolscript-javascript-0017
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, take its absolute value, then add one. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":4,"input":3},{"expected":3,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"9a7c80ba874fd76ffdde6dcd7c801961ed511a4842aca48e902cea7de11eedde"}
smolscript-javascript-0027
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, take the tens digit of its absolute value, then negate it. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":0,"input":3},{"expected":0,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"1a409a0d60eb042b3fb93b2451cf30644a2d0f7275f51bcdda85e780da5e429c"}
smolscript-javascript-0030
javascript
easy
strings
In JavaScript, Starting with ASCII string s, remove leading and trailing spaces, then remove leading and trailing spaces. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"Hello","input":"Hello"},{"expected":"Code","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"cca9cb316b095a5f43e5d501020f1a2560fabd1ab6d01cc7e014bc3c85b471cf"}
smolscript-javascript-0031
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, add one, then replace it with 1 if even, otherwise 0. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":1,"input":3},{"expected":0,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"cbc3e1dfa44187921111ce071b1fd55eeec1d1f77517fe5b8eaccbd2ee904204"}
smolscript-javascript-0036
javascript
easy
strings
In JavaScript, Starting with ASCII string s, keep characters from index floor(length/2) onward, then replace each run of spaces with one space. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"llo","input":"Hello"},{"expected":"ode ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"fb07691abbab941c2d2e2cab38a82e610294cbe906aa35ebe58632b714cf3059"}
smolscript-javascript-0037
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, subtract it from ten, then replace it with 1 if negative, otherwise 0. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":0,"input":3},{"expected":0,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"8fc3d5ec8a58bb8ed037c95243b39e138bc3db6caeb23e3b3d3f051205043c5d"}
smolscript-javascript-0040
javascript
easy
strings
In JavaScript, Starting with ASCII string s, remove leading and trailing spaces, then remove every space. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"Hello","input":"Hello"},{"expected":"Code","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"301490a47015f36166dd72b4b697e4aff2553ea17c9f51e162094b927c93511e"}
smolscript-javascript-0044
javascript
easy
strings
In JavaScript, Starting with ASCII string s, convert lowercase ASCII letters to uppercase, then remove leading and trailing spaces. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"HELLO","input":"Hello"},{"expected":"CODE","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"f6eb4ff056851f5303af3a4786f7d30769b2811bedeacdf791669495e1d8f4d8"}
smolscript-javascript-0051
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, take the last decimal digit of its absolute value, then clamp it to the inclusive range -5 to 5. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":3,"input":3},{"expected":2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"19cb30424ca4502257c78aa702f50371fdaa20d55720258943468f6cd3f4338a"}
smolscript-javascript-0052
javascript
easy
strings
In JavaScript, Starting with ASCII string s, remove vowels aeiou in either case, then remove leading and trailing spaces. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"Hll","input":"Hello"},{"expected":"Cd","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"d1a544f56b047ae4177c8da41a5b763bf4da168893ec4be53a547886b3b10d59"}
smolscript-javascript-0055
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, negate it, then negate it. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":3,"input":3},{"expected":-2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"639a0b435f428660ce84397ec135bd2c272c380c127678f73015bfc6c1ad18e2"}
smolscript-javascript-0065
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, double it, then subtract it from ten. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":4,"input":3},{"expected":14,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"255e8c11474e0b1dab4cf157b14f5eebed34011215128a194776f0ca9b68a088"}
smolscript-javascript-0096
javascript
easy
strings
In JavaScript, Starting with ASCII string s, keep the first floor(length/2) characters, then reverse the characters. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"eH","input":"Hello"},{"expected":"C ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"e533501c80778ea11cdea8dd707e77585dcd25d5c047f485c6459155db83dfa7"}
smolscript-javascript-0097
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, double it, then square it. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":36,"input":3},{"expected":16,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"696da44f39e4f5cae04885b8ffeac48c8965adb71666c160f3543c1a48384073"}
smolscript-javascript-0102
javascript
easy
strings
In JavaScript, Starting with ASCII string s, reverse the characters, then keep characters from index floor(length/2) onward. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"leH","input":"Hello"},{"expected":"oC ","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"f652e3fd3aea7f1ee9b2a7d98183fa328ab9c951d1f65af3531225693c51f99e"}
smolscript-javascript-0111
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, take its absolute value, then replace it with -1, 0, or 1 according to its sign. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":1,"input":3},{"expected":1,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"58eab35676e9b4ec23ccb1ce11d27e1f6a42dc625ce5ce6cddb3be3a33f2714d"}
smolscript-javascript-0116
javascript
easy
strings
In JavaScript, Starting with ASCII string s, remove leading and trailing spaces, then keep only ASCII letters. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"Hello","input":"Hello"},{"expected":"Code","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"fa9003f7c513422aa682419cb9801d44a1cd3352fdce2ca766089e8508d6dc5d"}
smolscript-javascript-0118
javascript
easy
strings
In JavaScript, Starting with ASCII string s, convert lowercase ASCII letters to uppercase, then keep the first floor(length/2) characters. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"HE","input":"Hello"},{"expected":" C","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"6431a94b41c9e16be570f8f286016b83aa5ba32fd5c5332f551a644377c620ea"}
smolscript-javascript-0123
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, take the tens digit of its absolute value, then clamp it to the inclusive range -5 to 5. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":0,"input":3},{"expected":0,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"d43630a01a001b34982d03e0bb237fde74f72b0ec44b5cbc1d5305cefb6868b1"}
smolscript-javascript-0124
javascript
easy
strings
In JavaScript, Starting with ASCII string s, keep only ASCII letters, then remove vowels aeiou in either case. Return the result.
Return only the function function solve(s). Do not include a main program.
solve
null
[{"expected":"Hll","input":"Hello"},{"expected":"Cd","input":" Code "}]
3
{"family":"string","input_domain":"ASCII s of at most 80 characters, without newlines.","protocol":"smolscript-0.3.0","semantic_id":"8b592c7adf270a7a4db3f93c3cead88418bc960d5896b26bea565587d16ad999"}
smolscript-javascript-0125
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, add one, then negate it. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":-4,"input":3},{"expected":1,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"0493781984f3ae49ad098a9a269b84988eb5ab11743b44ea48e6f79628a1ccd2"}
smolscript-javascript-0144
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, subtract it from ten, then take its absolute value. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":7,"input":3},{"expected":12,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"ed0d815415f377fe1bf85a8c5644228430482c210e3d4198f69d3c65be47c833"}
smolscript-javascript-0146
javascript
easy
arithmetic_conditions
In JavaScript, Starting with n, negate it, then take the last decimal digit of its absolute value. Return the result.
Return only the function function solve(n). Do not include a main program.
solve
null
[{"expected":3,"input":3},{"expected":2,"input":-2}]
3
{"family":"scalar","input_domain":"Integer n from -120 to 120.","protocol":"smolscript-0.3.0","semantic_id":"b09e5a661609d6d7b75aa9695f55b70256c50ea437d1acf0f4e18c3849cbf123"}
smolscript-javascript-0153
javascript
medium
collections_loops
In JavaScript, Select items at odd zero-based indices from values in original order. Return their last value. Return 0 when none are selected.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"78ccaeffcfcd1390bf6fc35b5de737c68e7996b2418298a555ca096e8ae741db"}
smolscript-javascript-0154
javascript
medium
collections_loops
In JavaScript, Select items with absolute value at most three from values in original order. Return their sum.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":6,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"4df8657463174d0e73c70aaaaf5e839e362bbac6151ae35c645f7b8b689b0730"}
smolscript-javascript-0163
javascript
medium
collections_loops
In JavaScript, Select even items from values in original order. Return their sum.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"d01e8428cc3c94e2cb37dce97a04d20d0b9626e783a8a918839d987c1daa4d47"}
smolscript-javascript-0164
javascript
medium
collections_loops
In JavaScript, Select all items from values in original order. Return their last value. Return 0 when none are selected.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":3,"input":[1,2,3]},{"expected":2,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"76bad3bb58e6ff67ffaf7145ba1aa9ba2511435c8e8ec4441af1dc3aff0a2585"}
smolscript-javascript-0168
javascript
medium
collections_loops
In JavaScript, Select odd items from values in original order. Return their number of distinct values.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"4722461795f3177f6a4b85e4beb9e5a366152d84cc746071f71c52adf659bac5"}
smolscript-javascript-0169
javascript
medium
collections_loops
In JavaScript, Select nonzero items from values in original order. Return their product. The empty product is 1.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":6,"input":[1,2,3]},{"expected":-4,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"3f13e1e2e638fcc61c94b3d84914471e61b7549a943c973f1329e05d6d14a88d"}
smolscript-javascript-0170
javascript
medium
frequency_tables
In JavaScript, Select items with absolute value at most three from values in original order. Return their largest frequency of a value.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":1,"input":[1,2,3]},{"expected":1,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"bdaa6f79490acdc7deae0b0b17c3b647cf8d6ef4d6fe905ab2d7821c0782dc0e"}
smolscript-javascript-0177
javascript
medium
collections_loops
In JavaScript, Select odd items from values in original order. Return their count.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"cc21e21b31751e7ce9b2f0e58985ef579f9a9f55587805c06f6bb6c2197a54ca"}
smolscript-javascript-0178
javascript
medium
collections_loops
In JavaScript, Select all items from values in original order. Return their count.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":3,"input":[1,2,3]},{"expected":3,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"d1ba8372b05884507f9cc75ebe084151798aff20106916b376453b3ec48b50e4"}
smolscript-javascript-0188
javascript
medium
collections_loops
In JavaScript, Select items at odd zero-based indices from values in original order. Return their sum.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":2,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"f437c8993c06242e214012b3399712402c921df3413b8fcc512dd5c9a2780b1c"}
smolscript-javascript-0217
javascript
moderate
collections_loops
In JavaScript, Select negative items from values in original order. For each selected item, replace it with -1, 0, or 1 according to its sign. Return their minimum. Return 0 when none are selected.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":0,"input":[1,2,3]},{"expected":-1,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"967239047947945d5586324408b57dc2524838deb9805f1d8d57b3968411bc64"}
smolscript-javascript-0219
javascript
moderate
collections_loops
In JavaScript, Select items with absolute value greater than three from values in original order. For each selected item, take its absolute value. Return their maximum minus minimum. Return 0 when none are selected.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":0,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"ddce88c4ca83a8f69ebd3939a187146059204a0c7ea0c03b14df672467b77b35"}
smolscript-javascript-0223
javascript
moderate
collections_loops
In JavaScript, Select items at even zero-based indices from values in original order. For each selected item, negate it. Return their sum.
Return only the function function solve(values). Do not include a main program.
solve
null
[{"expected":-4,"input":[1,2,3]},{"expected":0,"input":[-2,0,2]}]
3
{"family":"array","input_domain":"At most eight integers, each from -6 to 6.","protocol":"smolscript-0.3.0","semantic_id":"aa22d5ce24befd134488633bd13f5fd67ceaa5a1ec7f49a6e1f66fc2bcd46f47"}
smolscript-javascript-0232
javascript
medium
dom_events
In JavaScript, Implement setup(). When #action is clicked, increase the integer in #output by one. Attach an event listener; do not perform the action before a click.
Return function setup() only. The harness calls it once after loading the fixture.
setup
null
[]
3
{"base_css":"","family":"dom","fixture":"<button id=\"action\">Go</button><input id=\"input\" value=\"\"><p id=\"output\">0</p><ul id=\"items\"></ul><input id=\"check\" type=\"checkbox\">","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"33979e1d3e22318a1c2ed08cbb9b6338b0debe841c6bb30d403578f67abf96a5"}
smolscript-javascript-0234
javascript
medium
dom_events
In JavaScript, Implement setup(). When #action is clicked, copy the input value into #output. Attach an event listener; do not perform the action before a click.
Return function setup() only. The harness calls it once after loading the fixture.
setup
null
[]
3
{"base_css":"","family":"dom","fixture":"<button id=\"action\">Go</button><input id=\"input\" value=\"\"><p id=\"output\">0</p><ul id=\"items\"></ul><input id=\"check\" type=\"checkbox\">","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"3b18aa35f2f7d37d573f87e1e01f72483a1f17494b3fd7a9c93b3088f3cdd14f"}
smolscript-javascript-0243
javascript
medium
dom_events
In JavaScript, Implement setup(). When #action is clicked, set #output title to the input value. Attach an event listener; do not perform the action before a click.
Return function setup() only. The harness calls it once after loading the fixture.
setup
null
[]
3
{"base_css":"","family":"dom","fixture":"<button id=\"action\">Go</button><input id=\"input\" value=\"\"><p id=\"output\">0</p><ul id=\"items\"></ul><input id=\"check\" type=\"checkbox\">","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"4c314cdd8025e06207e1e7a3e6e97d34e25870e7bdbb208ec2339a3b9b627965"}
smolscript-javascript-0247
javascript
moderate
dom_events
In JavaScript, Implement setup(). On an input event from #input, copy the uppercased input into #output. Use a listener, leave the initial page unchanged, and handle repeated events.
Return function setup() only. The harness calls it once after loading the fixture.
setup
null
[]
3
{"base_css":"","family":"dom","fixture":"<button id=\"action\">Go</button><input id=\"input\" value=\"\"><p id=\"output\">0</p><ul id=\"items\"></ul><input id=\"check\" type=\"checkbox\">","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"e5a091807ba9eb36dbbdbc3aa7695e172838d907704c1fe133f3d876ea1d6b48"}
smolscript-html-0003
html
easy
semantic_structure
In HTML, Create an h1 heading reading Welcome. On its outer element, set right-to-left direction via dir. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"355715e248988addc97a08ed2eaa173e11795edac39e46b0c8304eac83ad0148"}
smolscript-html-0004
html
easy
semantic_structure
In HTML, Create an h1 heading reading Welcome. On its outer element, set the hidden attribute. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"5cf45411142515df22b8e277874ea4b60dc94f7fef618dcad1837257f57080a3"}
smolscript-html-0020
html
easy
semantic_structure
In HTML, Create a Save button with type button. On its outer element, set English language via lang. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"148a9a273a368cae6fc5a5512306b7db9723f1e94d2e019a67a8f03b57d76c70"}
smolscript-html-0027
html
easy
semantic_structure
In HTML, Create an image sourced from icon.png with alt text Star. On its outer element, set right-to-left direction via dir. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"90dda9b05cd5b7b74bb031197de8774c0a4c6db6ca4aa77276319223e022dfa7"}
smolscript-html-0031
html
easy
semantic_structure
In HTML, Create an email input named email. On its outer element, set a title attribute of Information. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"d1ea5eab6ed96ca52420a19945418340dca178aa843d8b58447207840a07c092"}
smolscript-html-0036
html
easy
semantic_structure
In HTML, Create an email input named email. On its outer element, set contenteditable set to true. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"a3db544611d662601b67cdf1a96bdbbf3d37611fd98385da0521bad04d2361b4"}
smolscript-html-0042
html
easy
semantic_structure
In HTML, Create a checkbox named agree. On its outer element, set contenteditable set to true. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"238d7b6241a9afcfa59a63809396cb0c32a1951b3f9bedaf650fe3dbafe51118"}
smolscript-html-0045
html
easy
semantic_structure
In HTML, Create a POST form targeting /send containing a Send button. On its outer element, set right-to-left direction via dir. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"251f12cc33e640e9100423b1369f4ca4e0d9f7d8037fe44cf4528450564ecc8e"}
smolscript-html-0047
html
easy
semantic_structure
In HTML, Create a POST form targeting /send containing a Send button. On its outer element, set keyboard focus via tabindex 0. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"1655aa8adec8b02fb33e362c61a75bb51ad7f4e9d770af6af882a0aec020dd9c"}
smolscript-html-0049
html
easy
semantic_structure
In HTML, Create an unordered list containing Tea then Water. On its outer element, set a title attribute of Information. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"fed910f70d4a9f37ba62b4d25f2ca21bab519ee7da372433edeecaed20e91b5d"}
smolscript-html-0054
html
easy
semantic_structure
In HTML, Create an unordered list containing Tea then Water. On its outer element, set contenteditable set to true. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"7cae165a7cc3269300df9dc82402e29ebd9931c95fcd47e01b773c9cf0c07b2e"}
smolscript-html-0067
html
easy
semantic_structure
In HTML, Create an article with an h2 News and a paragraph Today. On its outer element, set a title attribute of Information. Return an HTML fragment.
Return an HTML fragment only.
null
[]
3
{"base_css":"","family":"html","fixture":"","input_domain":null,"protocol":"smolscript-0.3.0","semantic_id":"4d40a0c8b5c8cfac4bf97b6eaca9ebf96318ed34170c72abd8041f3213ebe84c"}
End of preview. Expand in Data Studio

SmolScript

An original execution-based benchmark of basic programming for 25M–350M parameter language models. Evaluator 0.5.0, 350 default examples (fixed dataset edition 0.3.0), nine languages, MIT license.

Release status: execution-unverified candidate. All 350 default records have been generated and statically validated. No complete reference execution run or model baseline is claimed. The authoring environment has no Docker/Podman daemon; all 350 default reference solutions and their negative controls still require execution in the supplied sandbox image. See validation_report.json for the machine-readable audit. Do not treat this candidate as a validated leaderboard release until python validate.py succeeds.

Composition

Language Easy Medium Moderate Total
Python 26 13 5 44
JavaScript 27 13 4 44
HTML 21 11 3 35
CSS 21 10 4 35
C++ 24 12 4 40
C 23 12 4 39
Lua 21 11 3 35
C# 24 11 4 39
Rust 23 12 4 39
Total 210 105 35 350

Programming tasks cover arithmetic and conditions, ASCII string transformations, filtered collection reductions, frequency tables, and short combinations of basic operations. JavaScript includes 4 browser DOM/event tasks in the default subset. HTML tasks check elements, attributes, text, and nesting. CSS tasks check computed properties, selector scope, unaffected distractors, flex row/column geometry, and responsive breakpoints. No generated solution uses external packages.

Tasks are original compositions from an explicit operation grammar, not scraped HumanEval/MBPP/MultiPL-E questions. Variants change operations and observable behavior, not just names or numbers. Shared tasks across programming languages are intentional translations for comparative coverage. Within each language, deterministic behavioral probe fingerprints reject equivalent programming tasks. Web tasks have unique structural specs. Trigram similarity flags are reported; the seven retained pairs differ in count versus sum and have distinct behavior. This is a finite behavioral/structural audit, not a mathematical proof of semantic uniqueness. Difficulty labels are design judgments; empirical calibration on small models remains future work.

Install and build the offline sandbox

Requires Python 3.11+, Docker or Podman on Linux (or Docker Desktop's Linux VM), approximately 2 GB memory per concurrent container, and disk space for Chromium and compilers. GPU is optional for generation. All runtime downloads occur during image construction.

python -m venv .venv
. .venv/bin/activate
pip install -e '.[inference]'
docker build -f sandbox/Dockerfile -t smolscript-runtime:0.1.0 .
python validate.py

The image supplies CPython, Node.js, GCC/G++ (C11/C++17), Lua 5.4, Mono C#, Rust (edition 2021), and Playwright Chromium. Candidate functions use basic C# features supported by Mono. The base Playwright image and Python browser dependencies are pinned. OS compiler packages are resolved at build time; preserve/export the built image for exact runtime reproduction. Every evaluation records the immutable local image ID and available registry digests. Rebuilding later may produce a different image.

Containers run as UID 1000 with network disabled, a read-only root, no Linux capabilities, no privilege escalation, 2 GB memory/swap ceiling, one CPU, 512 processes, bounded temporary filesystems, CPU/wall timeouts, and bounded output. Compilation has a separate 30-second limit; each program test has a three-second CPU limit plus a one-second wall allowance. Browser operations have three-second timeouts and a container supervisor limit. Candidates have access only to their code, fixture, and input values; expected answers remain in the host scorer. No host home, Docker socket, credentials, or full dataset is mounted. There is no host-execution fallback. Containers are the required isolation boundary; use a dedicated worker for adversarial submissions.

The sandbox uses the documented Docker resource and isolation options and the Playwright Python container image. Evaluation requires no network after model/tokenizer weights and the image have been cached. To enforce offline Hugging Face loading, set HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1.

Validate

python validate.py                 # Full reference + negative-control execution
python validate.py --static-only   # Counts, uniqueness, oracle cases, hashes, Parquet
python -m unittest discover -s tests -v
python generators/build.py         # Deterministically regenerate all artifacts

validate.py checks every reference against every hidden test and rejects a deliberately wrong solution for every task. For programming tasks it also checks a plausible near-miss mutation where the hidden inputs distinguish it (missing transformation stage, mapping, or filter). Failure stops validation with the task ID. Missing sandbox/runtime exits 2 and records unverified coverage. Static-only success never marks execution as passed. The reference ASTs for all 44 Python tasks are also parsed by the local unit suite.

Evaluate a model

python evaluate.py --model HuggingFaceTB/SmolLM2-135M --output results.json
python evaluate.py --model HuggingFaceTB/SmolLM2-135M --output results.json --resume
python evaluate.py --model HuggingFaceTB/SmolLM2-135M --language python rust --difficulty easy --output subset.json

One fixed completion prompt (smolscript-base-completion-v3), one generation, seed 0, greedy decoding, no beam search, and versioned task budgets from 96 to 256 tokens. Starting batch size is 64, with automatic CUDA OOM backoff. Prompts are grouped by token budget and length; KV caching and supported last-token logits optimizations are enabled. Progress is reported between batches, avoiding per-token GPU-to-CPU synchronization. The same completion template is used for base and instruction models; no model-specific chat template is applied. The model revision resolves to an immutable commit and is retained on resume. Use --revision SHA for an explicit pin. Prompts contain task comments, the input domain, supplied standard-library imports, web fixtures/base styles where needed, and a function/markup prefix. Models continue the supplied source directly. References, public examples, hidden tests, and expected answers are never sent to the model.

Existing files require --resume. Settings, dataset/runner hashes, image ID and selected IDs must match. Completed task results are checkpointed atomically; a generated response is saved before execution, so an execution interruption can reuse it. Partial runs never receive a full score. Use one process per output path (a file lock enforces this). Context overflow is an explicit failure; input prompts are never silently truncated.

For externally generated code, create JSONL records {"id":"...","code":"..."} and use:

python evaluate.py --predictions predictions.jsonl --output results.json

Externally supplied predictions use complete source code (raw code or a single fenced code block). Model inference stores raw continuations and deterministically assembles the supplied prefix before scoring. Multiple or unfinished fences are rejected. Function tasks receive fixed stdin/stdout wrappers. Compiled languages compile once per task, then run a fresh process per test. HTML is parsed with html5lib and checked in Chromium with document scripts disabled. CSS syntax is reported with tinycss2 and behavior is tested against a fixed fixture at the specified widths. Browser tests assert DOM/computed styles and geometry, without image similarity.

Metrics

All metrics are on 0–100. A task passes only when every hidden assertion passes. With one generation, per-language accuracy is Pass@1. SmolScript Score and overall Pass@1 are the macro-average of the nine language accuracies. Syntax Success is likewise macro-averaged across languages and measures parse/compile success, separately from behavior. micro_accuracy is an explicitly secondary count-weighted diagnostic. No score is chance-adjusted.

Filters produce filtered_macro_score over selected languages rather than the official nine-language smolscript_score. Per-test outputs and pass/fail results are retained. Build failures count as syntax failures; runtime failures count as behavioral failures. Sandbox infrastructure errors stop the run instead of assigning a score.

examples/result-format.json illustrates output structure using explicitly synthetic numbers; it is not a model result.

Files and Hugging Face

data/smolscript.jsonl and data/smolscript.parquet contain the public test examples. To keep one consistent Parquet schema across modalities, tests and metadata are JSON strings in Parquet; JSONL uses native JSON values. Decode them with json.loads after loading through Hugging Face Datasets. Public reference_solution is null; full references are in references/solutions.jsonl. Hidden tests live in private_tests/hidden.jsonl, outside the public dataset split. These evaluation-only files are published for independent auditing; they are not access-controlled secrets. Never include them in model context. Offline evaluation requires downloading the complete repository, including these files.

from datasets import load_dataset
import json
rows = load_dataset('dotlabs/smolscript', split='test')
metadata = json.loads(rows[0]['metadata'])

The generator, runners and audit reports are included in this repository. Record the Hugging Face repository commit, manifest checksums, generation settings, dependency versions and image ID with any reported result.

Fast default (0.3.0)

The default split and both local/Modal evaluators now use the same fixed 350 IDs, selected from the prior 1,000-task edition by deterministic SHA256 ranking within language, difficulty, family and category strata. The selection manifest lists every ID and its hash. IDs, instructions, references and tests are preserved for selected tasks. The original 2,000-task edition is archived under archive/v0.1.0; Hugging Face users can request config full2000. The prior 1,000-task edition is also preserved as config previous1000 under archive/v0.2.0. Current evaluation commands use the 350-task edition.

The language budgets (before a 32-token moderate-task allowance, capped at 256) are Python 128, JavaScript 192, HTML 160, CSS 96, C++ 224, C 256, Lua 160, C# 256, Rust 256. They depend only on language/difficulty, never reference solutions. --max-new-tokens N overrides these budgets for a separately recorded experiment; --batch-size N overrides the default 64. A response that hits its cap is scored as generated; incorrect or incomplete code still fails the normal execution tests. Generation statistics include token-limit completions, OOM retries, final batch size, elapsed generation time and measured token throughput.

Example: python evaluate.py --model HuggingFaceTB/SmolLM2-135M --batch-size 64 --output results-v030.json. Generated batches are checkpointed before execution, and resume skips their inference. Numerical batching differences can change greedy outputs for near-tied logits. This release reduces the task count from 1,000 to 350 and retains the fast decoding budgets introduced in 0.2.0. Its scores must not be merged with earlier editions. Template IDs are smolscript-0.5.0 and cognirank2-v5; use a new output path. No GPU throughput speedup is claimed without a measured run.

Browser timeout handling

The phase-watchdog-v1 evaluator supervises the browser worker in a separate process group. Chromium launch has a 20-second limit; trusted setup/cleanup phases have a 45-second watchdog. Generated browser code and its assertions have a per-scenario wall limit of max(6, 3*timeout_seconds) (nine seconds for current tasks), in addition to three-second Playwright operation timeouts. This also bounds page.evaluate, script injection, and stuck page teardown, which do not all obey Playwright's default timeout.

A candidate-phase timeout preserves successful syntax parsing and completed observations, fails the unfinished assertions, and lets later tasks continue. Setup failures remain infrastructure errors and do not receive an invented score. The supervisor kills the worker process group during cleanup. Docker/Modal outer deadlines provide additional containment; an outer infrastructure timeout remains a failed evaluation. Modal evaluators run without credentials, and worker environments are explicitly filtered.

Rebuild the Docker image after updating these files. The Modal launcher automatically submits the updated supervisor and worker image. Full browser runtime validation remains unverified in the local authoring environment; watchdog regression tests use trusted synthetic worker fixtures.

CSS fixture setup correction

CSS styles are inserted synchronously with a DOM style element; the evaluator does not use Playwright 1.56 add_style_tag, whose inline-style path waits for a load callback. This avoids waiting for that callback on the HTML/CSS pages with scripting disabled. Trusted fixture and baseline errors remain infrastructure failures, separate from candidate execution. Timeout diagnostics now name the precise phase, operation, scenario and language and include bounded worker stderr.

The Modal path first checks runtime availability and a trusted CSS computed-style/distractor probe, before model generation. Worker processes use explicit subprocess UID/GID settings and private writable HOME/XDG/TMP directories; no Python pre-exec callback is used in the threaded launcher. These changes preserve the fixed 350-example dataset and scoring definition. End-to-end Modal browser verification is still required; local tests cover the injection protocol, diagnostic fields, preflight failure and watchdog behavior.

Base-model completion protocol (0.5.0)

The same completion template is used for every model, including instruction models. There is no chat wrapper, conversational instruction block, worked solution, reference implementation, test input, expected answer, or answer-dependent repair. Example prompt ending:

# Starting with n, double it, then take the last decimal digit of its absolute value. Return the result.
# Integer n from -120 to 120.
def solve(n):

The prompt ends immediately after the header newline, with no trailing spaces or tabs. The model supplies its own body indentation. Python headers omit type annotations. JavaScript, C, C++, C#, Rust and Lua receive their function/method openings (including the C# class), and applicable supplied imports. HTML receives a task comment followed by <; CSS receives its fixture/context and task as a CSS comment. examples/base-prompts.json contains an example for each language. completion.py is the authoritative prompt and assembly implementation.

The supplied prefix is attached to the generated continuation. Answer-independent lexical scope extraction keeps the first completed function/class body and discards trailing prose. Python uses indentation tokens; braced languages count delimiters while ignoring ordinary strings/comments (and supported regex/raw/verbatim strings); Lua counts block keywords. These are constrained completion delimiters, not general language parsers. Syntax and behavior are still checked inside the sandbox. Missing delimiters, malformed indentation, expressions, and return values are never repaired, and no closing suffix is invented. Complete entry-point definitions emitted from scratch, including a single fenced code block, are accepted as deterministic formatting alternatives.

Raw continuations and assembled evaluated_code are saved separately. The standalone --predictions path continues to accept complete code and bypasses the completion prefix. All 350 supplied reference bodies roundtrip through assembly (Python body AST equality, other languages source equality); this is a static assembly check, not complete runtime validation. Full isolated reference execution and a new KLM benchmark run remain outstanding.

Use a new output path for smolscript-0.5.0 / cognirank2-v5. Dataset edition/selection 0.3.0 remains fixed; only the evaluation prompt/assembly protocol changes. Old scores are not comparable and must be rerun for leaderboard comparisons. Token budgets, deterministic greedy decoding, batch size 64, eight isolated Modal scoring workers, tests and weights remain the same.

Behavioral equivalence (0.5.0)

Correctness is determined by the executable tests, never by source similarity. Newline-only function openings now leave indentation generation to the model. Fenced body completions preserve indentation, and valid Python source with module-level helper functions is retained.

HTML checks accept semantic equivalents: case-insensitive enumerated attribute values (method="POST"/"post", dir="RTL"/"rtl"), equivalent hidden/boolean states, numeric attribute representations, and class-token ordering. Required elements, nesting, targets and content still matter. URL, ID, name and ordinary text values are not indiscriminately lowercased. Attribute lookup errors and missing required attributes still fail.

For ordinary HTML text, collapsible ASCII whitespace is normalized; preformatted text retains significant whitespace, and pre-line preserves line breaks. Extra inline spans with the same text can satisfy the same text check. JavaScript string outputs and programming string tasks retain exact observable content. CSS compares computed styles, so equivalent selectors, shorthands and color notations can pass when they produce all required styles and leave distractors unchanged.

HTML/CSS syntax reporting is now independent of behavioral testing: the native browser may recover from a parsing issue and still satisfy every assertion. Such a task can pass behavior while Syntax Success reports false. Full HTML documents and fragments are parsed in the appropriate mode. JavaScript syntax failures still prevent execution. No model source is rewritten to repair errors.

The optional hidden_test_pass_rate diagnostic averages test-pass fractions per task and then macro-averages across languages. It shows partial functional success. The official SmolScript Score remains all-tests-required Pass@1, macro-averaged across nine languages; this diagnostic does not affect CogniRank weights. It does not award credit for comments describing a solution that was not implemented.

These scoring/format changes require a new output path (smolscript-0.5.0, cognirank2-v5). All 350 tasks, reference implementations and hidden test files remain byte-identical. The local equivalence controls use observation fixtures and a mocked browser; full real-browser reference validation remains outstanding.

Downloads last month
263

Space using dotlabs/smolscript 1