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 getMaxValueFrom2DArray(aList) of me –> 16 –max value is 16 on getMaxValueFrom2DArray(aList) set anArray to current application’s NSArray’s arrayWithArray:aList set eRes to (anArray’s valueForKeyPath:"@unionOfArrays.self")’s valueForKeyPath:"@max.self" return eRes as integer end getMaxValueFrom2DArray |
More from my site
(Visited 95 times, 1 visits today)