Discuss Scratch

mastergamerx-details
Scratcher
100+ posts

Dictionaries AND Lists [A lot of supporters]

Support, I need this.
A-MARIO-PLAYER
Scratcher
1000+ posts

Dictionaries AND Lists [A lot of supporters]

This is technically 2D lists, which is rejected.
PaperMarioFan2022
Scratcher
1000+ posts

Dictionaries AND Lists [A lot of supporters]

A-MARIO-PLAYER wrote:

This is technically 2D lists, which is rejected.
Something like this?
1.6 2D lists
2D lists, also known as 2D arrays, nested lists, or matrices, are a type of data structure that allows you to put an entire list as an element of another list; that is, it allows you to put lists inside of lists. These sorts of data structures are used widely in other programming languages and functions similarly to a table.

This block, and others, would allow you to create 2D lists to store information. However, this is too complicated for what is supposed to be an introductory programming language. There are workarounds possible by using an ordinary list and an indexing function. For those who are interested, it may be worth checking out Snap!. It is a block-based programming language designed for experienced programmers and has more advanced data structures than Scratch does.
I don't believe it is the same thing. It looks completely different.
WindowsAdmin
Scratcher
1000+ posts

Dictionaries AND Lists [A lot of supporters]

A-MARIO-PLAYER wrote:

This is technically 2D lists, which is rejected.
This is a 2014 topic, it would have been closed by now
ThisIsTemp1
Scratcher
1000+ posts

Dictionaries AND Lists [A lot of supporters]

Bump.
8to16
Scratcher
1000+ posts

Dictionaries AND Lists [A lot of supporters]

bumpto16
Honey_Dreamz
Scratcher
100+ posts

Dictionaries AND Lists [A lot of supporters]

There is a workaround; add the items to a list in such a way that makes sure they have the same number. For example, item number one in list1 corresponds to item number 1 in list2, etcetera. Then, you can use these corresponding list numbers to do whatever you would need to do with dictionaries. Although the dictionaries make it a bit simpler, the workaround truly isn't that difficult either in my opinion, just needs a few extra blocks to make it work.

Last edited by Honey_Dreamz (Oct. 4, 2024 10:06:36)

medians
Scratcher
1000+ posts

Dictionaries AND Lists [A lot of supporters]

Bringing this topic up.
8to16
Scratcher
1000+ posts

Dictionaries AND Lists [A lot of supporters]

Support only if it's an extension. It would be pretty useful for some projects I am planning, but this will confuse many new scratchers — however, probably not as many as sin or cos already does.

Last edited by 8to16 (Jan. 6, 2025 17:28:21)

Cool_kid092
Scratcher
100+ posts

Dictionaries AND Lists [A lot of supporters]

semi support. tho it would be cool for something else, it would be confusing for new scratchers
jmb1293634
Scratcher
100+ posts

Dictionaries AND Lists [A lot of supporters]

theonlygusti wrote:

I think that we should just have lists within lists, so 2d, 3d, even 4d lists.

Then we could do:
(item (1 v) of (item (2 v) of [list v]))
this is rejected:
1.6 2D lists
2D lists, also known as 2D arrays, nested lists, or matrices, are a type of data structure that allows you to put an entire list as an element of another list; that is, it allows you to put lists inside of lists. These sorts of data structures are used widely in other programming languages and functions similarly to a table.

This block, and others, would allow you to create 2D lists to store information. However, this is too complicated for what is supposed to be an introductory programming language. There are workarounds possible by using an ordinary list and an indexing function. For those who are interested, it may be worth checking out Snap!. It is a block-based programming language designed for experienced programmers and has more advanced data structures than Scratch does.
add () to sublist () of [list v]::lists stack

Last edited by jmb1293634 (Jan. 6, 2025 17:50:06)

Powered by DjangoBB