Dictionaries

The puzzles from this category allow you to effectively store, transfer and retrieve various data. Particularly, a dictionary is useful for storing multiple parameters and for passing them in bulk from and to JavaScript and over network.

Visual programming blocks to work with dictionaries

Contents

Puzzles Reference

create empty dict

Returns a dictionary containing no data records.

Create empty dictionary in visual programming editor

In JavaScript, a dictionary is represented by an Object without any properties, that is { }.

create dict with

Returns a dictionary with given keys and values.

Block to create dictionary with given key-value pairs

Keys/values can be lists:

Dictionary keys and values as lists

or multi-line texts, where each line represents a key or value:

Dictionary keys and values as text strings

dict set key

Sets the item to be associated with a specified key in a dictionary. The key must be a text, while the assigned value may be of any type (text, number, list, other dictionary, etc).

Visual programming block to set dictionary key

dict get key

Returns the item associated with a specified key in a dictionary.

Visual programming block to retrieve values from dictionaries

get keys

Returns a list of all keys present in a dictionary.

Visual logic block to retrieve all keys from dictionary

dict check key

Checks if a specified key is present in a dictionary, and returns the Boolean-typed result true or false.

Checking dictionary key with visual programming

dict remove key

Removes the item associated with a specified key in a dictionary, and deletes the key itself.

Block to remove dictionary key

is empty

Checks if a specified dictionary contains no keys, and returns the Boolean-typed result true or false.

Visual logic block to check if dictionary is empty

See Also

Dictionaries store elements by names. If you need an ordered storage with indexed elements, refer to lists.

Having Troubles with Puzzles?

Seek help on the forums!