Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,14 @@
on array ()
cnt = paramCount()
if cnt=0 then return
arr = []
arr[param(cnt)] = 0
repeat with d = cnt-1 down to 1
newArr = []
repeat with i = 1 to param(d)
newArr[i] = arr.duplicate() -- duplicate does a deep copy
end repeat
arr = newArr.duplicate()
end repeat
return arr
end

View file

@ -0,0 +1,10 @@
-- creates 4-dimensional array with specified ranges (data defaults to 0)
a = array(2, 3, 4, 5)
put a[1][2][3][4]
-- 0
a[1][2][3][4] = 23
put a[1][2][3][4]
-- 23
a[1][2][3][4] = 42
put a[1][2][3][4]
-- 42