1
1
Fork 0
exercism/jq/proverb/proverb.jq
Christina Sørensen ca6b099b05
feat(jq): proverb
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-12-18 06:10:13 +01:00

7 lines
259 B
Text

def nail(start; prev; next):
if start == null then []
elif next|length == 0 then ["And all for the want of a \(start)."]
else ["For want of a \(prev) the \(next[0]) was lost."] + (nail(start; next[0]; next[1:]))
end;
.strings|nail(.[0]; .[0]; .[1:])