Task

The goal is to create an associative array (also known as a dictionary, map, or hash).



Related tasks:

 Associative arrays/Iteration
 Hash from two arrays


See also

 Array
 Associative array: Creation, Iteration
 Collections
 Compound data type
 Doubly-linked list: Definition, Element definition, Element insertion, List Traversal, Element Removal
 Linked list
 Queue: Definition, Usage
 Set
 Singly-linked list: Element definition, Element insertion, List Traversal, Element Removal
 Stack


mydictionary = (red=0xff0000, green=0x00ff00, blue=0x0000ff)
 
redblue = "purple"
mydictionary put(redblue, 0xff00ff)
 
255 == mydictionary("blue")
65280 == mydictionary("green")
16711935 == mydictionary("purple")