Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Loops-Nested/AppleScript/loops-nested-1.applescript
Normal file
16
Task/Loops-Nested/AppleScript/loops-nested-1.applescript
Normal 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
|
||||
19
Task/Loops-Nested/AppleScript/loops-nested-2.applescript
Normal file
19
Task/Loops-Nested/AppleScript/loops-nested-2.applescript
Normal 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
|
||||
15
Task/Loops-Nested/AppleScript/loops-nested-3.applescript
Normal file
15
Task/Loops-Nested/AppleScript/loops-nested-3.applescript
Normal 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
|
||||
11
Task/Loops-Nested/AppleScript/loops-nested-4.applescript
Normal file
11
Task/Loops-Nested/AppleScript/loops-nested-4.applescript
Normal 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.
|
||||
1
Task/Loops-Nested/AppleScript/loops-nested-5.applescript
Normal file
1
Task/Loops-Nested/AppleScript/loops-nested-5.applescript
Normal 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}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue