September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
2
Task/Loops-While/Jq/loops-while-1.jq
Normal file
2
Task/Loops-While/Jq/loops-while-1.jq
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# To avoid printing 0, test if the input is greater than 1
|
||||
1024 | recurse( if . > 1 then ./2 | floor else empty end)
|
||||
1
Task/Loops-While/Jq/loops-while-2.jq
Normal file
1
Task/Loops-While/Jq/loops-while-2.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
1024 | recurse( ./2 | floor; . > 0)
|
||||
2
Task/Loops-While/Jq/loops-while-3.jq
Normal file
2
Task/Loops-While/Jq/loops-while-3.jq
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def task: if . > 0 then ., (./2 | floor | task) else empty end;
|
||||
1024|task
|
||||
3
Task/Loops-While/Jq/loops-while-4.jq
Normal file
3
Task/Loops-While/Jq/loops-while-4.jq
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def while(cond; update):
|
||||
def _while: if cond then ., (update | _while) else empty end;
|
||||
_while;
|
||||
1
Task/Loops-While/Jq/loops-while-5.jq
Normal file
1
Task/Loops-While/Jq/loops-while-5.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
1024|while(. > 0; ./2|floor)
|
||||
Loading…
Add table
Add a link
Reference in a new issue