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
500+ 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 studio of my best projects!
Tera RP
Common misconceptions about Scratch
_________________________

toki! mi nimi li WinOkawiton. taso sina ken toki tawa mi: jan Win o!
Hello! My name is WindOctahedron (a.k.a. WinOkawiton). But you can tell to me: person Wind (a.k.a. Win) call!!
Hello! My name is WindOctahedron, but you can call me “Wind”!
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
500+ posts

Hashtables

I just found out that this is a duplicate.

The studio of my best projects!
Tera RP
Common misconceptions about Scratch
_________________________

toki! mi nimi li WinOkawiton. taso sina ken toki tawa mi: jan Win o!
Hello! My name is WindOctahedron (a.k.a. WinOkawiton). But you can tell to me: person Wind (a.k.a. Win) call!!
Hello! My name is WindOctahedron, but you can call me “Wind”!

Powered by DjangoBB

Standard | Mobile