Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
# A function to create an m x n matrix
|
||||
# filled with the input element
|
||||
def matrix(m;n):
|
||||
. as $init
|
||||
| ( [ range(0; n + 1) ] | map($init)) as $row
|
||||
| ( [ range(0; m + 1) ] | map($row))
|
||||
;
|
||||
|
||||
# Task: create a matrix with dimensions specified by the user
|
||||
# and set the [1,2] element:
|
||||
(0 | matrix($m|tonumber; $n|tonumber)) | setpath([1,2]; 99)
|
||||
|
|
@ -0,0 +1 @@
|
|||
[[0,0,0,0],[0,0,99,0],[0,0,0,0]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue