How to resolve the algorithm Hash from two arrays step by step in the SenseTalk programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Hash from two arrays step by step in the SenseTalk programming language
Table of Contents
Problem Statement
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)
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Hash from two arrays step by step in the SenseTalk programming language
Source code in the sensetalk programming language
set keyList to ["red", "green", "blue"]
set valueList to [150,0,128]
repeat with n=1 to the number of items in keyList
set map.(item n of keyList) to item n of valueList
end repeat
put map
--> (blue:"128", green:"0", red:"150")
You may also check:How to resolve the algorithm Equilibrium index step by step in the Seed7 programming language
You may also check:How to resolve the algorithm Calendar step by step in the XLISP programming language
You may also check:How to resolve the algorithm Sum of a series step by step in the Lucid programming language
You may also check:How to resolve the algorithm Day of the week step by step in the Swift programming language
You may also check:How to resolve the algorithm Averages/Arithmetic mean step by step in the AppleScript programming language