RosettaCodeData/Task/Hash-from-two-arrays/Icon/hash-from-two-arrays.icon
2023-07-01 13:44:08 -04:00

12 lines
449 B
Text

link ximage # to format the structure
procedure main(arglist) #: demonstrate hash from 2 lists
local keylist
if *arglist = 0 then arglist := [1,2,3,4] # ensure there's a list
every put(keylist := [], "key-" || !arglist) # make keys for each entry
every (T := table())[keylist[ i := 1 to *keylist ]] := arglist[i] # create the hash table
write(ximage(T)) # show result
end