September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
8
Task/Forward-difference/Jq/forward-difference-1.jq
Normal file
8
Task/Forward-difference/Jq/forward-difference-1.jq
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# If n is a non-negative number and if input is
|
||||
# a (possibly empty) array of numbers,
|
||||
# emit an array, even if the input list is too short:
|
||||
def ndiff(n):
|
||||
if n==0 then .
|
||||
elif n == 1 then . as $in | [range(1;length) | $in[.] - $in[.-1]]
|
||||
else ndiff(1) | ndiff(n-1)
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue