Discuss Scratch

braxbroscratcher
Scratcher
1000+ posts

Arrays

BookOwl wrote:

braxbroscratcher wrote:

Sigton wrote:

An array is just a more accurate term for lists.

First class lists would allow for what you are suggesting and, plus it would be a more intuitive feature.

Sigton
But it can be more than one dimension. Lists can only be one.
First class lists would allow infinite dimensions.

No support because first class lists would be a lot simpler and more powerful.
That's a bad reason to no support. If you no support because there is another suggestion that's better, then that's mildly unfair to the writer of the suggestion.

Instead, it'd be better to support but say that another idea would accomplish the goal more efficiently.
Sigton
Scratcher
1000+ posts

Arrays

braxbroscratcher wrote:

Sigton wrote:

An array is just a more accurate term for lists.

First class lists would allow for what you are suggesting and, plus it would be a more intuitive feature.

Sigton
But it can be more than one dimension. Lists can only be one.
First class lists can have unlimited dimensions.

Sigton
braxbroscratcher
Scratcher
1000+ posts

Arrays

Sigton wrote:

braxbroscratcher wrote:

Sigton wrote:

An array is just a more accurate term for lists.

First class lists would allow for what you are suggesting and, plus it would be a more intuitive feature.

Sigton
But it can be more than one dimension. Lists can only be one.
First class lists can have unlimited dimensions.

Sigton
ik, i was correcting you on your first point.
Jonathan50
Scratcher
1000+ posts

Arrays

Sigton wrote:

An array is just a more accurate term for lists.
A list is a sequence of things.
An array is a way to implement a list. (Linked lists are another way.) It's several consecutive places in your computers memory (one for each element of the array).
Scratch's lists are implemented as dynamic arrays.
WeaponGod243
Scratcher
79 posts

Arrays

BUMP
-ShadowOfTheFuture-
Scratcher
1000+ posts

Arrays

Support! I can see many instances in which arrays would be useful.
WeaponGod243
Scratcher
79 posts

Arrays

BUMP
llloofagelll
Scratcher
16 posts

Arrays

Sheep_maker wrote:

So 2D lists? What blocks would be used to get/set these arrays?

I think first-class lists might be easier to understand/use when it comes to multidimensional lists
I think something like get item from array^ letter: <letter> number: <number>
NanoPIex
Scratcher
500+ posts

Arrays

This seems way too complex for new scratchers. No support.
Hearst10
Scratcher
100+ posts

Arrays

rejected, but I don't want to quote.
lapisi
Scratcher
1000+ posts

Arrays

rejected
1.7 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.

This block, and others, would allow you to create 2D lists to store information, sort of like a table. However, this is too complicated for what is supposed to be an introductory programming language. In addition, 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 more experienced programmers, and has more advanced data structures than Scratch does.
EDIT: ninja'd

Last edited by lapisi (Jan. 30, 2021 15:58:43)

PicoMetrics
Scratcher
1000+ posts

Arrays

Support for uses listed.

mOCKUP?

array () with data () ::variables

Last edited by PicoMetrics (Jan. 30, 2021 17:54:01)

PicoMetrics
Scratcher
1000+ posts

Arrays

PicoMetrics wrote:

Support for uses listed.

mOCKUP?

array () with data () ::variables
add array () to listv::variables

Last edited by PicoMetrics (Jan. 30, 2021 17:54:57)

lapisi
Scratcher
1000+ posts

Arrays

PicoMetrics wrote:

PicoMetrics wrote:

Support for uses listed.

mOCKUP?

array () with data () ::variables
add array () to listv::variables
but it's rejected

Last edited by lapisi (Jan. 30, 2021 17:59:31)

the2000
Scratcher
1000+ posts

Arrays

NanoPIex wrote:

This seems way too complex for new scratchers. No support.
Za-Chary
Scratcher
1000+ posts

Arrays

lapisi wrote:

rejected
1.7 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.

This block, and others, would allow you to create 2D lists to store information, sort of like a table. However, this is too complicated for what is supposed to be an introductory programming language. In addition, 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 more experienced programmers, and has more advanced data structures than Scratch does.
EDIT: ninja'd
Thanks for the quote — closed as rejected.

Ha, you got me; I'm not changing the text color though.

Last edited by Za-Chary (Jan. 30, 2021 19:20:40)

Powered by DjangoBB