Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Sudan-function/Jq/sudan-function.jq
Normal file
13
Task/Sudan-function/Jq/sudan-function.jq
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
def sudan(n;x;y):
|
||||
if n == 0 then x+y
|
||||
elif y == 0 then x
|
||||
else sudan(n-1; sudan(n;x;y-1); sudan(n;x;y-1) + y)
|
||||
end;
|
||||
|
||||
# For testing and syntactic convenience:
|
||||
def sudan:
|
||||
"sudan(\(.[0]); \(.[1]); \(.[2])) => \(sudan(.[0]; .[1]; .[2]))";
|
||||
|
||||
# Illustrations
|
||||
[0,0,0], [1,1,1], [2,1,1], [3,1,1], [2,2,1]
|
||||
| sudan
|
||||
Loading…
Add table
Add a link
Reference in a new issue