Discuss Scratch

Monniasza_spzoo
Scratcher
100+ posts

Hashtables

Hashtables will store data, and its items will be referred to with text.
set [] of [ v] to [] :: #de3430 //create and/or set
reporter (get [] of [ v] :: #de3430) :: grey
predicate < hashtable [ v] contains key [thing] ? :: #de3430> :: grey
predicate < hashtable [ v] contains value [thing] ? :: #de3430> :: grey
remove [] from [ v] :: #de3430
set list [ v] to all keys of [ v] :: #de3430
reporter (length of hashtable [ v] :: #de3430) :: grey

Useful with nested hashtables, multi-hashtables,hash-nested lists, treemaps and nested lists.

Last edited by Monniasza_spzoo (Aug. 24, 2019 10:58:33)

WindOctahedron
Scratcher
1000+ posts

Hashtables

(Removed - I didn't notice the “create and set”.)
Also, #de3430 will be the colour for hashtable blocks, if we won't find a better colour.

Last edited by WindOctahedron (Aug. 24, 2019 10:38:21)


The message above may contain wrong information, rude remarks, or something embarrassing to my current self. In this case, please ignore it and remember that I likely wrote it back when I didn't know what “respect” truly meant. I really hate thinking about it again.
Monniasza_spzoo
Scratcher
100+ posts

Hashtables

WindOctahedron wrote:

(Removed - I didn't notice the “create and set”.)
Also, #de3430 will be the colour for hashtable blocks, if we won't find a better colour.
Recolored according to post.
Monniasza_spzoo
Scratcher
100+ posts

Hashtables

Hashtables exist in Java under java.util.Map and java.util.Hashtable
WindOctahedron
Scratcher
1000+ posts

Hashtables

I just found out that this is a duplicate.

The message above may contain wrong information, rude remarks, or something embarrassing to my current self. In this case, please ignore it and remember that I likely wrote it back when I didn't know what “respect” truly meant. I really hate thinking about it again.

Powered by DjangoBB