##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: October 2016 # Modified: 2016-10-09/20:18-0400 ##+ # # max.icn, demonstrate the maximum value function # link fullimag procedure main() write(max(1,2,3)) write() # using the apply operator comes in handy for max L := [1,2,3,4,5] write(max!L) # equivalent to write(max(1,2,3,4,5)) write() # max also accepts structures directly write(max(L)) # although max accepts structures, results are somewhat "fuzzy" L1 := ["abc", "def"] L2 := ["uvw", "xyz", "123"] L3 := ["UVW", "XYZ"] L4 := ["ZZZ", "457", "002"] L5 := ["YYY", "456", "001"] write(fullimage(max(L1, L2, L3, L4, L5))) end