AppleScript名:2Dリスト内の要素のうち最小値を求める |
— Created 2017-10-01 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aList to {{1, 2, 3, 4, 5, 6, 4}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 16, 0, 0}} –7,6, 8 items set aRes to getMinValueFrom2DArray(aList) of me –> 0 –min value is 0 on getMinValueFrom2DArray(aList) set anArray to current application’s NSArray’s arrayWithArray:aList set eRes to (anArray’s valueForKeyPath:"@unionOfArrays.self")’s valueForKeyPath:"@min.self" return eRes as integer end getMinValueFrom2DArray |
More from my site
(Visited 35 times, 1 visits today)