Data update
This commit is contained in:
parent
52a6ef48dd
commit
157b70a810
604 changed files with 14253 additions and 2100 deletions
|
|
@ -1,8 +1,8 @@
|
|||
def fib(n):
|
||||
def aux: if . == 0 then 0
|
||||
elif . == 1 then 1
|
||||
else (. - 1 | aux) + (. - 2 | aux)
|
||||
end;
|
||||
if n < 0 then error("negative arguments not allowed")
|
||||
else n | aux
|
||||
end ;
|
||||
else [2, 0, 1]
|
||||
| recurse( if .[0] > n then empty
|
||||
else [ .[0]+1, .[2], .[1]+.[2] ]
|
||||
end)
|
||||
| .[1]
|
||||
end;
|
||||
|
|
|
|||
8
Task/Anonymous-recursion/Jq/anonymous-recursion-3.jq
Normal file
8
Task/Anonymous-recursion/Jq/anonymous-recursion-3.jq
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
def fib(n):
|
||||
def aux: if . == 0 then 0
|
||||
elif . == 1 then 1
|
||||
else (. - 1 | aux) + (. - 2 | aux)
|
||||
end;
|
||||
if n < 0 then error("negative arguments not allowed")
|
||||
else n | aux
|
||||
end ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue