I would use lists (especially a 2D list) to store different colors, text, and more…
Would also be more code efficient depending on how they are used…
I would use lists (especially a 2D list) to store different colors, text, and more…
Would also be more code efficient depending on how they are used…
WHY
There have been a few projects where arrays could be helpful. Such as storing positions of different positions of spaces in a grid
WHAT
It could have add to array, set array and remove from array blocks. You could also be able to loop through arrays
WHERE
It could be its own tab or in the variables tab
MORE USES
it’s like:
var array = [1, 2, 3];
and you access items in the array like array[0] (which would equal 1)
Lists are a more general term. You can usually use them interchangeably. Lists are usually implemented with arrays (not always though. Linked lists are not, for example.)
How did I not see this topic lol it was literally posted in 30 mins ago
it was just merged with your topic, which makes it seem like it was posted in 30 minutes ago
Arrays would generally in their own category called “Lists” which could, in theory, be placed right next to the variables tab. A lot of new variables like “item in list,” would also be needed to make it all work. Blocks like “Remove from List/Array” and “Add to List/Array” would also make this very useful…
If this gets added eventually, I cannot wait to see what kinds of awesome things people make using them…
Everything that would be useful with Arrays/Lists/Collections:
All lot of these are already possible with what we currently have, but arrays would make the process a lot faster…
Oooh cool. I like arrays.[quote=“AwesomeOnion, post:1, topic:53136, full:true”]
This might be something we’ll try in the beta editor, but no guarantees on when that will be.
One reason we haven’t implemented a collection type in Hopscotch is that for it to be useful, I think you’d need a lot of built-in functionality. This would clutter up the editor for more beginner users.
In the comments can you give specific examples of what you’d use collections for? That will help me think about what they would enable.
Also, feel free to shout out ideas about what to call them!
Again, this is not on the roadmap yet, it’s strictly exploratory
[/quote]
Lists
Anything that uses lists
My word search generator
Append(1, list)
List[1]
ReplaceAtPos[text,2,list]
And so on.
Hi, Mathematics2, welcome to the forum.
You might remember me. I’m Crosbyman64 (the Crosbyman64).
I used Scratch before so I definitely know what you’re talking about.
Hi @Mathematics2! Welcome to the forum!
I think that this is a great suggestion and I can think of lots of uses for lists!
I can think of a couple:
Much faster tile finding system (in terms of platformers). It would be convenient to just do item # of (item) instead of having to check all indexes to find what you’re looking for
Data Strings in general (and Awesome_E would agree with me on this one).
I know right! Lists are possible right now but they are all hard to see or in my lists case slow. I hope it’s added soon. That will really help!
I just noticed you typed your name as Mathamatics2 instead of Mathematics2… clever…
If it does get added, it’ll most likely be added as arrays, as I found them to be more useful than lists.
In terms of Python, arrays can handle mathematical operations whereas lists cannot, and they can store data very compactly. The only downside is that arrays need to be declared, which is to be expected anyways. As variables in hopscotch need to be declared, and lists also need to be declared in scratch.
Q: What is an array?
A: An array is a collection of similar data elements stored at contiguous memory locations. It is the simplest data structure where each data element can be accessed directly by only using its index number.
It’s basically the superior version of lists.
Imagine if you could declare an array simply by inputting values separated by commas, I would definitely make that one way of declaring them because then I could just type in all the values and instantly have an array (I would also make a duplicate as a variable to return the entire string for copying purposes).
i.e., set array (list) to (127,255,192,64) = list=(i[127,255,192,64]) //this is referencing python in a way
In WolframLagige it’s “list={1,”this is a list!”,3}
And yes that’s what it’s called silly me.
Thank you for noticing that. I fixed it.
Welcome to the forum!