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,16 @@
on loopDemo(array, stopVal)
set out to {}
repeat with i from 1 to (count array)
set inRow to item i of array
set outRow to {}
repeat with j from 1 to (count inRow)
set n to item j of inRow
set end of outRow to n
if (n = stopVal) then exit repeat # <--
end repeat
set end of out to outRow
if (n = stopVal) then exit repeat # <--
end repeat
return out
end loopDemo

View file

@ -0,0 +1,19 @@
on loopDemo(array, stopVal)
set out to {}
repeat with i from 1 to (count array)
set inRow to item i of array
set len to (count inRow)
set n to beginning of inRow
set outRow to {n}
set j to 2
repeat until ((j > len) or (n = stopVal)) # <--
set n to item j of inRow
set end of outRow to n
set j to j + 1
end repeat
set end of out to outRow
if (n = stopVal) then exit repeat # <--
end repeat
return out
end loopDemo

View file

@ -0,0 +1,15 @@
on loopDemo(array, stopVal)
set out to {}
repeat with i from 1 to (count array)
set inRow to item i of array
set outRow to {}
repeat with j from 1 to (count inRow)
set n to item j of inRow
set end of outRow to n
if (n = stopVal) then return out & {outRow} # <--
end repeat
set end of out to outRow
end repeat
return out
end loopDemo

View file

@ -0,0 +1,11 @@
local array, stopVal, row
set array to {}
set stopVal to 20
repeat 10 times
set row to {}
repeat 10 times
set end of row to (random number from 1 to stopVal)
end repeat
set end of array to row
end repeat
loopDemo(array, stopVal) -- Any of the handlers above.

View file

@ -0,0 +1 @@
{{15, 8, 9, 8, 9, 9, 10, 16, 3, 6}, {11, 3, 14, 18, 17, 1, 16, 15, 14, 7}, {4, 20}}