RosettaCodeData/Task/Test-a-function/Jq/test-a-function-3.jq

4 lines
124 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
def factorial: if . <= 0 then 1 else . * ((. - 1) | factorial) end;
def palindrome: explode as $in | ($in|reverse) == $in;