/* Hash from two arrays (Rosetta code) in Picat. http://rosettacode.org/wiki/Hash_from_two_arrays """ Using two Arrays of equal length, create a Hash object where the elements from one array (the keys) are linked to the elements of the other (the values) """ This program was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ % import v3_utils. % import util. % import cp. main => go. go ?=> A = [a,b,c,d,e], B = [1,2,3,4,5], Map = new_map([K=V : {K,V} in zip(A,B)]), println(Map), nl. go => true.