September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
11
Task/Loops-Nested/Jq/loops-nested-1.jq
Normal file
11
Task/Loops-Nested/Jq/loops-nested-1.jq
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Given an m x n matrix,
|
||||
# produce a stream of the matrix elements (taken row-wise)
|
||||
# up to but excluding the first occurrence of $max
|
||||
def stream($max):
|
||||
. as $matrix
|
||||
| length as $m
|
||||
| (.[0] | length) as $n
|
||||
| label $ok
|
||||
| {i: range(0;$m), j: range(0;$n)}
|
||||
| $matrix[.i][.j] as $m
|
||||
| if $m == $max then break $ok else $m end ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue