I think Scratch 2.0 should have support matrices, like it does for variables and lists. By using matrices, storing data in a grid format would become much easier. When using variables in a grid display, the maximum number of cells cannot go above the number of variables created, and even when you don't need to display them, storing grid data in a list can be difficult. Matrices would go under the Variables pallet with the variables and lists, and could be shown/hidden like variables and lists.
For those of you who don't know what a matrix is, it's a grid of data, like a "table" from math class or a "spreadsheet" in Microsoft Excel. Here is a 4x3 matrix:
0 2 0 1
3 4 1 0
6 2 12 9
They can vary in size as well, like lists.
Along with the matrices, blocks such as these could be included:
set item (),() to []
delete item (),()
delete all of column ()
delete all of row ()
insert column at ()
insert row at ()
add row to top
add row to bottom
add column to left
add column to right
(item (),() )
(height of matrix)
(width of matrix)
show matrix
hide matrix
etc.
Does anyone agree?
Supporters:
Me (Greenatic)
Digitechs
Harakou
veggieman101
Death_Wish
Last edited by Greenatic (2011-07-30 10:49:35)
Offline
DigiTechs wrote:
Nice, i think i'll hit the [support] button. But, these matrices blocks would have to go in the Variables pallet, because they can hold variables, without physically showing the veiwer on the stage.
Yeah, that was what I intended. Sorry if that wasn't clear; I'll edit the post now.
BTW, I haven't made a suggestions page yet.
Last edited by Greenatic (2011-07-28 16:12:12)
Offline
so say if we were making a microsoft excell on a Scratch Virtual Computer, we would use the block "Show matrice [dropdown v]" and "Hide matrice [dropdown v]" . Nice, eh?
EDIT: forgot my " at the end of the block idea for this.
Last edited by DigiTechs (2011-07-28 16:12:24)
Offline
DigiTechs wrote:
Also, a block that shows the matrice on the stage.
Yep, I'll add that now.
Offline
Anyone else agree?
UGH, my first run-in with 60 second rule! IT IS SO ANNOYING!!! And I thought those people were just whiners...
Offline
DigiTechs wrote:
Weird, not seen the 60 seccond rule.
Basically, it means that you can't post more than once a minute. It can be very annoying when two users are on at the same time and are conversing with each other.
Offline
Harakou wrote:
Oh, this is something I've wanted for a while. (I think there was a suggestion for it that gathered some support a while back, but I can't remember.) I completely support!
Are you sure about the suggestion? I searched the suggestions page and only found two suggestions: "Matrixes" (epic fail ) and "Matrices". One had 1 vote and the other had 4, though I forgot which was which.
Offline
Greenatic wrote:
Harakou wrote:
Oh, this is something I've wanted for a while. (I think there was a suggestion for it that gathered some support a while back, but I can't remember.) I completely support!
Are you sure about the suggestion? I searched the suggestions page and only found two suggestions: "Matrixes" (epic fail
) and "Matrices". One had 1 vote and the other had 4, though I forgot which was which.
It was a thread before that suggestion page was around, actually. I think the original topic was posted by The-Whiz.
Offline
Harakou wrote:
Greenatic wrote:
Harakou wrote:
Oh, this is something I've wanted for a while. (I think there was a suggestion for it that gathered some support a while back, but I can't remember.) I completely support!
Are you sure about the suggestion? I searched the suggestions page and only found two suggestions: "Matrixes" (epic fail
) and "Matrices". One had 1 vote and the other had 4, though I forgot which was which.
It was a thread before that suggestion page was around, actually. I think the original topic was posted by The-Whiz.
I went and found it:
http://scratch.mit.edu/forums/viewtopic … 58&p=1
But it hasn't been posted on since October 2010. Why don't we contact its supporters and ask them if they'll vote for this? A suggestions page was almost made for that thread, but never was...
Do you think it would be better to call them "Matrices", or "Tables" as suggested on the other thread?
Offline
This would be nice, but can't you do this all with 2 lists?
Offline
Greenatic wrote:
Harakou wrote:
Greenatic wrote:
Are you sure about the suggestion? I searched the suggestions page and only found two suggestions: "Matrixes" (epic fail) and "Matrices". One had 1 vote and the other had 4, though I forgot which was which.
It was a thread before that suggestion page was around, actually. I think the original topic was posted by The-Whiz.
I went and found it:
http://scratch.mit.edu/forums/viewtopic … 58&p=1
But it hasn't been posted on since October 2010. Why don't we contact its supporters and ask them if they'll vote for this? A suggestions page was almost made for that thread, but never was...
Do you think it would be better to call them "Matrices", or "Tables" as suggested on the other thread?
I prefer "matrix" just because it's the more technical term (even though 2D array is most accurate) but table would make it easier to understand for some.'
randomnumber53 wrote:
This would be nice, but can't you do this all with 2 lists?
Yes, but when you have two lists you have to go though the columns with "hard code," whereas with a matix you can just change a variable.
Offline
randomnumber53 wrote:
This would be nice, but can't you do this all with 2 lists?
What do you mean? The whole point of a matrix in Scratch is that you can easily change the dimensions. Even if you use a list for every column, that makes it impossible to increase the size of your matrix in a script. And while *technically* there is a complicated formula you can use to change a list into a matrix, performing the aforementioned operations is much more difficult. This is what drives many users away from anything that would require storing data in a grid format. With matrices, this all becomes much easier, and the whole point of Scratch is to be beginner-friendly. Complicated list-interpretation formulas just aren't beginner-friendly.
Offline
Greenatic wrote:
randomnumber53 wrote:
This would be nice, but can't you do this all with 2 lists?
What do you mean? The whole point of a matrix in Scratch is that you can easily change the dimensions. Even if you use a list for every column, that makes it impossible to increase the size of your matrix in a script. And while *technically* there is a complicated formula you can use to change a list into a matrix, performing the aforementioned operations is much more difficult. This is what drives many users away from anything that would require storing data in a grid format. With matrices, this all becomes much easier, and the whole point of Scratch is to be beginner-friendly. Complicated list-interpretation formulas just aren't beginner-friendly.
Yeah, algorithms like that aren't just unfriendly to beginners; they're inefficient and way more work than they're worth. I can't think of a single programming language besides Scratch that doesn't have matrices in some way.
Offline
randomnumber53 wrote:
This would be nice, but can't you do this all with 2 lists?
Exactly!
Offline
I think there should be multidimensional arrays (array=list). Then you could be like
(draw object with [list v])
Offline
Scratch is supposed to be user-friendly. Take, for example, the <when[ ]key pressed> block.
<when[ ]key pressed>
do something
=
<when green flag clicked>
<forever>
<wait until> <key[ ]pressed?>
do something
<end>
=
<when green flag clicked>
<forever if> <key[ ]pressed?>
do something
<end>
=
<when green flag clicked>
<forever>
<if> <key[ ]pressed?>
do something
<end>
<end>
There are many easy ways of running this one block. Yet there is still a <when[ ]key pressed> block.
Why should beginners have to use complex list -> matrix formulas and the like?
Last edited by Greenatic (2011-07-28 22:13:56)
Offline
veggieman001 wrote:
I think there should be multidimensional arrays (array=list). Then you could be like
(draw object with [list v])
So you think we should not only include variables, lists (1D array), and matrices (2D array), but 3D arrays as well?
Offline
Who else wants matrices?
Last edited by Greenatic (2011-07-29 13:23:27)
Offline
DigiTechs wrote:
Greenatic wrote:
Who else wants matrices?
Mee! lolfail, i already supported.
Anyone else? Scratch needs this...
OK, looks like some people need a little convincing.
Ever wanted to make a game with a layout like a Pokemon one? Or another game like this?
Let's use Diamond/Pearl as an example. I've read online that its setup is made up of squares in a grid format (duh), which are grouped into 32x32 larger squares that scroll. Ever wanted to do this? You needed lots of color sensing or <if touching sprite> sensing. Not with matrices!
1111211111
1000000001
1011100001
1013100001
1000000001
1111111111
OK, let's say the above matrix represents a field setup for a game.
0's represent spaces where you can walk.
1's represent walls or trees, where you cannot walk.
2 represents the exit.
3 represents a cabin door, and the 1's right around it represent its sides.
(This is just an example. You can do many things with this.)
The script:
When Green Flag Clicked:
set currentrow to 2
set cuurentcol to 2
forever {
if < <[up arrow] key pressed> and <not <(cell currentrow - 1, currentcol) = 1> > > {
change currentrow by -1}
if < <[down arrow] key pressed> and <not <(currentrow + 1, currentcol) = 1> > > {
change currentrow by 1}
if < <[left arrow] key pressed> and <not <(currentrow, currentcol - 1) = 1> > > {
change currentcol by -1}
if < <[right arrow] key pressed> and <not <(currentrow, currentcol + 1) = 1> > > {
change currentcol by 1}
if < (cell currentrow, currentcol) = 2 > {
broadcast nextroom}
if < (cell currentrow, currentcol) = 3 > {
broadcast cabin}
While at first this might seem complicated, remember, with sensing, you had to use different scripts for every room! Now, you can just change the matrix!
This makes many things SO much easier!
Last edited by Greenatic (2011-07-29 14:33:07)
Offline
Greenatic wrote:
veggieman001 wrote:
I think there should be multidimensional arrays (array=list). Then you could be like
(draw object with [list v])So you think we should not only include variables, lists (1D array), and matrices (2D array), but 3D arrays as well?
I think any dimension of arrays. 4d, 5d, 6d, whatever.
Offline