Discuss Scratch
- SaintSquireen
-
6 posts
Whole New Variable Type - Arrays
Hello Scratchers,
I've been thinking. In my most recent projects I've had to work with some hardcore scrolling action and having just 300 clones on the screen at any given point and lists and variables and Scroll - X and Scroll - Y and all of this other mind-blowingly difficult and confusing blocks and stuff and stuff and more stuff!
I had to make a program that would have 20 columns and 15 rows of cloned blocks ( equaling 300 total cloned blocks ), and I had to create a list that would store a certain variable that would correspond to a certain costume that would be displayed for each cloned block. Then after that, I had to use Scroll - X and Scroll - Y and the specific Column # and specific Row # of each cloned block to find which variable number from in the before-mentioned list corresponded to that block so that no matter how you changed the Scroll - X or Scroll - Y variable, you would change the world in that determined direction and therefore changing the way each cloned block would look and then therefore changing which portion of the world you were looking at, and therefore making it seem like the character was moving across the world.
What would make my life sooo much easier was if there was whole new variable type called the Array.
You could then have a certain variable placed in a certain column and/or row of an array and have that corresponding to the certain row/column # of that certain cloned block from all the way at the beginning of this post!
I am talking to you Scratch Team. Wouldn't you think that this could be useful?
Now for you Scratchers, what do you think about this? Would a new Array variable type making your programs and games so much better and/or easier to code? Would it be any useful? Would many games use this, even if it was implemented in the new Scratch 2.0? Let everybody know in the comments.
Happy Scratching,
~SaintSquireen
Two projects that this corresponds to:
First - Scrolling Adventure RPG: http://beta.scratch.mit.edu/projects/10048048/
Second - Minecraft/Terraria: http://beta.scratch.mit.edu/projects/10043758/
Studio devoted to Advanced Projects: http://beta.scratch.mit.edu/studios/190746/
I've been thinking. In my most recent projects I've had to work with some hardcore scrolling action and having just 300 clones on the screen at any given point and lists and variables and Scroll - X and Scroll - Y and all of this other mind-blowingly difficult and confusing blocks and stuff and stuff and more stuff!
I had to make a program that would have 20 columns and 15 rows of cloned blocks ( equaling 300 total cloned blocks ), and I had to create a list that would store a certain variable that would correspond to a certain costume that would be displayed for each cloned block. Then after that, I had to use Scroll - X and Scroll - Y and the specific Column # and specific Row # of each cloned block to find which variable number from in the before-mentioned list corresponded to that block so that no matter how you changed the Scroll - X or Scroll - Y variable, you would change the world in that determined direction and therefore changing the way each cloned block would look and then therefore changing which portion of the world you were looking at, and therefore making it seem like the character was moving across the world.
What would make my life sooo much easier was if there was whole new variable type called the Array.
You could then have a certain variable placed in a certain column and/or row of an array and have that corresponding to the certain row/column # of that certain cloned block from all the way at the beginning of this post!
I am talking to you Scratch Team. Wouldn't you think that this could be useful?
Now for you Scratchers, what do you think about this? Would a new Array variable type making your programs and games so much better and/or easier to code? Would it be any useful? Would many games use this, even if it was implemented in the new Scratch 2.0? Let everybody know in the comments.

Happy Scratching,
~SaintSquireen
Two projects that this corresponds to:
First - Scrolling Adventure RPG: http://beta.scratch.mit.edu/projects/10048048/
Second - Minecraft/Terraria: http://beta.scratch.mit.edu/projects/10043758/
Studio devoted to Advanced Projects: http://beta.scratch.mit.edu/studios/190746/
- HwoDragon
-
2 posts
Whole New Variable Type - Arrays
Scratch is great for making small projects, but sometimes you need to store a large amount of data in a scratch program. Lists are all very well and good for this, you have a list called “Names” one called “Levels” “Exp” etc. But what if you need 50 columns to a character? I know scratch is supposed to be simple and easy to learn, and a matrix might be a little advanced, but I still think being able to make one would be helpful. I mean, my graphing calculator can store a matrix, and scratch is definitely more powerful than a calculator. Trees would be another option. I tried to make a dialogue tree for a recent game but ended up scrapping the whole project and remaking it in another language
I'm not sure how trees would work but I think they would expand scratch's possibilities.

- Firedrake969
-
1000+ posts
Whole New Variable Type - Arrays
Matrices as in 2D arrays? +1
Trees? Elaborate, please.
Trees? Elaborate, please.
- HwoDragon
-
2 posts
Whole New Variable Type - Arrays
Right, a 2d array. Technically, real matrices are allowed to extend to 3d and theoretical 4d, but if you need that much storage space in scratch, you shouldn't really be using scratch to make your project.
But I digress, a 2d array would be a great addition.
But I digress, a 2d array would be a great addition.
- zakattack7
-
1 post
Whole New Variable Type - Arrays
I was thinking on how nice it would be to have 2-D arrays in scratch think about it you could make it easy to make board games and other Grid based games in Scratch
If you don't know what a 2-D array is its basically the same as a list but instead of using just one integer to define each entry ie.
If you don't know what a 2-D array is its basically the same as a list but instead of using just one integer to define each entry ie.
It uses two integers to define each entry
- Sonickyle
-
1000+ posts
Whole New Variable Type - Arrays
Already possible; I've seen it before.
- xlk
-
100+ posts
Whole New Variable Type - Arrays
a list of 100 items. First ten are one row, 11-20 are the second row, etc.
There you go, all you have to do is go to item (((x) join(y)) + (1))
There you go, all you have to do is go to item (((x) join(y)) + (1))
- prgmstr
-
13 posts
Whole New Variable Type - Arrays
Scratch REALLY REALLY needs multidementional arrays/multi-layered lists!
Anyone with me???
Anyone with me???
- Asjali
-
100+ posts
Whole New Variable Type - Arrays
I don't think so.
My engine, Minus, performs movements and interactions within a simulated three-dimensional array through only the use of several variables and a single list. Thus, what purpose would an integrated multidimensional array function serve other than to provide added convenience? Also, what do you mean by a multilayered list?
My engine, Minus, performs movements and interactions within a simulated three-dimensional array through only the use of several variables and a single list. Thus, what purpose would an integrated multidimensional array function serve other than to provide added convenience? Also, what do you mean by a multilayered list?
- turkey3
-
1000+ posts
Whole New Variable Type - Arrays
Support. It's easier to organize complex data hierarchies (I.e. John then John's clothes then the clothes' colors etc.)
- fezzinate
-
100+ posts
Whole New Variable Type - Arrays
I don't think so.
My engine, Minus, performs movements and interactions within a simulated three-dimensional array through only the use of several variables and a single list. Thus, what purpose would an integrated multidimensional array function serve other than to provide added convenience? Also, what do you mean by a multilayered list?
No one is saying it can't be done with a 1-dimensional array it just makes an otherwise very simple task that users young users can grow into and learn into something that's insanely abstract and complex. Translating between 1-dimensional and 2-dimensional is no simple task. I feel it prevents young users from learning about 2-dimensional data
- LiquidMetal
-
100+ posts
Whole New Variable Type - Arrays
My Multidimensional List / Array blocks may help you. 

- Blaze349
-
1000+ posts
Whole New Variable Type - Arrays
I know we can always try to replicate arrays with lists but when you are making
levels for a tile-based game it is excruciatingly boring to repeat enter then move 1
digit, then enter and move a digit and so on. With a level like this we can easily use
double digit numbers without find and replacing with difficulty in TextWrangler. Also
reading numbers from a grid is easier than reading numbers from a list because a grid
allows you to visualise your map. We could also have it so just like there's a variable
sub-category and a list sub-category there could also be a array subcategory. Here are some blocks:

And one by
I will constantly update this. Thanks for reading!
levels for a tile-based game it is excruciatingly boring to repeat enter then move 1
digit, then enter and move a digit and so on. With a level like this we can easily use
double digit numbers without find and replacing with difficulty in TextWrangler. Also
reading numbers from a grid is easier than reading numbers from a list because a grid
allows you to visualise your map. We could also have it so just like there's a variable
sub-category and a list sub-category there could also be a array subcategory. Here are some blocks:
Here's is a mockup.BLOCKSscratchblocks] create array called of width() an of height() with default value //If you want to make an array with code.

And one by
try to replicate arrays with lists but when you are makingI know we can always
levels for a tile-based game it is excruciatingly boring to repeat enter then move 1
digit, then enter and move a digit and so on. With a level like this we can easily use
double digit numbers without find and replacing with difficulty in TextWrangler. Also
reading numbers from a grid is easier than reading numbers from a list because a grid
allows you to visualise your map. We could also have it so just like there's a variable
sub-category and a list sub-category there could also be a array subcategory. Here are some blocks:Here's is a mockup.BLOCKSscratchblocks] create array called of width() an of height() with default value //If you want to make an array with code.
I will constantly update this. Thanks for reading!SUPPORTERSPH-zero
poniesreso
AGCCloud_a
CannonZ
dracae
AwesomeGameCreator
I think the menu should be
I will constantly update this. Thanks for reading!
SUPPORTERSPH-zero
poniesreso
AGCCloud_a
CannonZ
dracae
AwesomeGameCreator
BSH1
Blueinkproductions
Last edited by Blaze349 (June 29, 2014 00:09:13)
- PH-zero
-
100+ posts
Whole New Variable Type - Arrays
I always strongly supported arrays even though i know workarounds.
They would be pretty handy
They would be pretty handy

- Blaze349
-
1000+ posts
Whole New Variable Type - Arrays
I always strongly supported arrays even though i know workarounds.
They would be pretty handy

- poniesareso
-
100+ posts
Whole New Variable Type - Arrays
Arrays would be great to have. Convenient yet useful and helpful, this is a great idea. Support!