A catalog tool: listed by construction. A tool built for a request carries the report of its own admission here.
def lines(s):
out = []
cur = ''
for ch in s:
if ch == '\n':
out = out + [cur]
cur = ''
else:
cur = cur + ch
if cur != '':
out = out + [cur]
return out
def solve(s):
out = ''
first = True
for l in lines(s):
if first:
out = out + l
first = False
else:
out = out + ',' + l
return out
8 test cases ship with it; the first three:
| in | out |
|---|---|
eab Hufye eab Zed hufye0 apple dqvm | eab,Hufye,eab,Zed,hufye0,apple,dqvm |
wxz Piuyaz wxz Zed piuyaz1 apple ypsn | wxz,Piuyaz,wxz,Zed,piuyaz1,apple,ypsn |
vgdzcx Pyq vgdzcx Zed pyq2 apple xrval | vgdzcx,Pyq,vgdzcx,Zed,pyq2,apple,xrval |
GET https://research.zaiba.cloud/api/v1/programs/lines_to_csv
POST https://research.zaiba.cloud/api/v1/programs/lines_to_csv/run
{"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/lines_to_csv/code
# 200 · text/plain · the tool as one Python file, written by the library's authors