This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#76 2012-09-02 11:45:54

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: 2-D Arrays

OverPowered wrote:

zammer990 wrote:

It's already possible, my game Path uses a 16x16 array with the (letter () of []) block. And to edit one you just load the item you need into a separate list as single items, edit it and replace the old item. For items larger than 1 letter, you just iteratively add it to a temp until it reaches a break character (a space) then adds that to the edit list.
I just don't think enough people would use it for there to be a need, especially since there is a workaround.

People would only use this for every tile-based game, like Minecraft-style games on Scratch, strategy gams like Civilization, and most board games... One reason these are less prevalent, I believe, is that it's harder to program these than simpler action games or animations. This makes those games easier.

The "workaround" you speak of needs a text parser that completely rewrites an item both for input and output for changes to the list. This might be feasible for a 16x16 board, but if it is much larger, such as 40x30, then rewriting an entire line for only one change means also inefficiently rewriting 39 unneeded blocks within that item. This is just a horribly slow process and really could be simplified with a table.  smile

It doesn't need to rewrite the whole item, as it simply edits a single item of an editing list. Basically:

Code:

111111111
0101010101
111111111
0101010101
111111111

want to edit line 2

editinglist:
0
1
0
1
0
1
0
1
0
1
0

change a single item

0
1
1
1
0
1
0
1
0
1

reload it into the list
111111111
0111010101 use the replace item() of [] with [] block, but in the [] use the editing list's reporter
111111111
0101010101
111111111

http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#77 2012-09-02 12:32:08

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: 2-D Arrays

zammer990 wrote:

OverPowered wrote:

zammer990 wrote:

It's already possible, my game Path uses a 16x16 array with the (letter () of []) block. And to edit one you just load the item you need into a separate list as single items, edit it and replace the old item. For items larger than 1 letter, you just iteratively add it to a temp until it reaches a break character (a space) then adds that to the edit list.
I just don't think enough people would use it for there to be a need, especially since there is a workaround.

People would only use this for every tile-based game, like Minecraft-style games on Scratch, strategy gams like Civilization, and most board games... One reason these are less prevalent, I believe, is that it's harder to program these than simpler action games or animations. This makes those games easier.

The "workaround" you speak of needs a text parser that completely rewrites an item both for input and output for changes to the list. This might be feasible for a 16x16 board, but if it is much larger, such as 40x30, then rewriting an entire line for only one change means also inefficiently rewriting 39 unneeded blocks within that item. This is just a horribly slow process and really could be simplified with a table.  smile

It doesn't need to rewrite the whole item, as it simply edits a single item of an editing list. Basically:

Code:

111111111
0101010101
111111111
0101010101
111111111

want to edit line 2

editinglist:
0
1
0
1
0
1
0
1
0
1
0

change a single item

0
1
1
1
0
1
0
1
0
1

reload it into the list
111111111
0111010101 use the replace item() of [] with [] block, but in the [] use the editing list's reporter
111111111
0101010101
111111111

http://wiki.scratch.mit.edu/wiki/Array#method_2

Or we could just make a "replace letter ( ) of [ ] with [ ]" block.

Last edited by Molybdenum (2012-09-02 12:33:00)


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#78 2012-09-02 13:06:57

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: 2-D Arrays

Molybdenum wrote:

zammer990 wrote:

OverPowered wrote:


People would only use this for every tile-based game, like Minecraft-style games on Scratch, strategy gams like Civilization, and most board games... One reason these are less prevalent, I believe, is that it's harder to program these than simpler action games or animations. This makes those games easier.

The "workaround" you speak of needs a text parser that completely rewrites an item both for input and output for changes to the list. This might be feasible for a 16x16 board, but if it is much larger, such as 40x30, then rewriting an entire line for only one change means also inefficiently rewriting 39 unneeded blocks within that item. This is just a horribly slow process and really could be simplified with a table.  smile

It doesn't need to rewrite the whole item, as it simply edits a single item of an editing list. Basically:

Code:

111111111
0101010101
111111111
0101010101
111111111

want to edit line 2

editinglist:
0
1
0
1
0
1
0
1
0
1
0

change a single item

0
1
1
1
0
1
0
1
0
1

reload it into the list
111111111
0111010101 use the replace item() of [] with [] block, but in the [] use the editing list's reporter
111111111
0101010101
111111111

http://wiki.scratch.mit.edu/wiki/Array#method_2

Or we could just make a "replace letter ( ) of [ ] with [ ]" block.

that would be nicer than a (in my opinion) rather tedious and cumbersome looking nested array system


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#79 2012-09-02 17:59:51

OverPowered
Scratcher
Registered: 2012-07-27
Posts: 100+

Re: 2-D Arrays

zammer990 wrote:

Molybdenum wrote:

zammer990 wrote:


It doesn't need to rewrite the whole item, as it simply edits a single item of an editing list. Basically:

Code:

111111111
0101010101
111111111
0101010101
111111111

want to edit line 2

editinglist:
0
1
0
1
0
1
0
1
0
1
0

change a single item

0
1
1
1
0
1
0
1
0
1

reload it into the list
111111111
0111010101 use the replace item() of [] with [] block, but in the [] use the editing list's reporter
111111111
0101010101
111111111

http://wiki.scratch.mit.edu/wiki/Array#method_2

Or we could just make a "replace letter ( ) of [ ] with [ ]" block.

that would be nicer than a (in my opinion) rather tedious and cumbersome looking nested array system

Zammer, I am sorry if I misspoke, but to edit JUST ONE peice of data, all peices of information in line two need to be added and, if of varying length, parsed apart into "editinglist" and then "editinglist" has to replace the old item. With a 40-wide grid, "editignlist" would have to be edited 42 times (delete all, add all, change one) just for a simple change to one piece of information.

I believe an argument against removing "forever if" block applies here, too - if you're not going to use why does it matter if it's there? You can continue using lists as long as you'd like, but these would be available for the rest of us.  smile


Newest project: Tunnel TEST ~http://blocks.scratchr.org/API.php?user=OverPowered&action=onlineStatus~ On my mind: Unicameralism

Offline

 

#80 2012-09-02 18:22:22

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: 2-D Arrays

OverPowered wrote:

Zammer, I am sorry if I misspoke, but to edit JUST ONE peice of data, all peices of information in line two need to be added and, if of varying length, parsed apart into "editinglist" and then "editinglist" has to replace the old item. With a 40-wide grid, "editignlist" would have to be edited 42 times (delete all, add all, change one) just for a simple change to one piece of information.

I believe an argument against removing "forever if" block applies here, too - if you're not going to use why does it matter if it's there? You can continue using lists as long as you'd like, but these would be available for the rest of us.  smile

I understand your point of view, but by main argument concerning forever if was that it had a very simple workaround and that the ST had some blocks that could be easily worked around, and didn't have others; the ST seems reluctant to add many new blocks that have workarounds and yet some persist. Since a large percentile of scratchers wouldn't use the nested lists, or tables. And there is a workaround, it doesn't need to be added.


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#81 2012-09-02 21:48:46

OverPowered
Scratcher
Registered: 2012-07-27
Posts: 100+

Re: 2-D Arrays

There is a workaround, but, as I have detailed, it can be both difficult to program and have a major slowing effect on programs when they need to do many changes quickly. I belive this addition would be the equivalent of adding lists to Scratch - it's possible to have multiple "items" in a variable but really quite tedious. There was a workaround, but the Scratch team added lists. Why? It's a relatively standard part of other programming languages and really helps Scratchers make better projects.


Newest project: Tunnel TEST ~http://blocks.scratchr.org/API.php?user=OverPowered&action=onlineStatus~ On my mind: Unicameralism

Offline

 

#82 2012-09-16 08:45:03

OverPowered
Scratcher
Registered: 2012-07-27
Posts: 100+

Re: 2-D Arrays

Bump.
Still need this...


Newest project: Tunnel TEST ~http://blocks.scratchr.org/API.php?user=OverPowered&action=onlineStatus~ On my mind: Unicameralism

Offline

 

#83 2012-09-16 09:28:16

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: 2-D Arrays

OverPowered wrote:

zammer990 wrote:

Molybdenum wrote:

http://wiki.scratch.mit.edu/wiki/Array#method_2

Or we could just make a "replace letter ( ) of [ ] with [ ]" block.

that would be nicer than a (in my opinion) rather tedious and cumbersome looking nested array system

Zammer, I am sorry if I misspoke, but to edit JUST ONE peice of data, all peices of information in line two need to be added and, if of varying length, parsed apart into "editinglist" and then "editinglist" has to replace the old item. With a 40-wide grid, "editignlist" would have to be edited 42 times (delete all, add all, change one) just for a simple change to one piece of information.

I believe an argument against removing "forever if" block applies here, too - if you're not going to use why does it matter if it's there? You can continue using lists as long as you'd like, but these would be available for the rest of us.  smile

You misread my post. A replace letter ( ) of [ ] with [ ] block would make it so that you only need one edit, not 42. Also, the wiki link method is also easier.

Last edited by Molybdenum (2012-09-16 09:28:46)


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#84 2012-09-16 10:14:59

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: 2-D Arrays

Molybdenum wrote:

OverPowered wrote:

zammer990 wrote:


that would be nicer than a (in my opinion) rather tedious and cumbersome looking nested array system

Zammer, I am sorry if I misspoke, but to edit JUST ONE peice of data, all peices of information in line two need to be added and, if of varying length, parsed apart into "editinglist" and then "editinglist" has to replace the old item. With a 40-wide grid, "editignlist" would have to be edited 42 times (delete all, add all, change one) just for a simple change to one piece of information.

I believe an argument against removing "forever if" block applies here, too - if you're not going to use why does it matter if it's there? You can continue using lists as long as you'd like, but these would be available for the rest of us.  smile

You misread my post. A replace letter ( ) of [ ] with [ ] block would make it so that you only need one edit, not 42. Also, the wiki link method is also easier.

True, a block like that would make it simpler. The idea has merit, I'm simply against it. Well, it's up the the scratch team.


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#85 2012-09-16 22:33:18

OverPowered
Scratcher
Registered: 2012-07-27
Posts: 100+

Re: 2-D Arrays

zammer990 wrote:

Molybdenum wrote:

OverPowered wrote:

Zammer, I am sorry if I misspoke, but to edit JUST ONE peice of data, all peices of information in line two need to be added and, if of varying length, parsed apart into "editinglist" and then "editinglist" has to replace the old item. With a 40-wide grid, "editignlist" would have to be edited 42 times (delete all, add all, change one) just for a simple change to one piece of information.

I believe an argument against removing "forever if" block applies here, too - if you're not going to use why does it matter if it's there? You can continue using lists as long as you'd like, but these would be available for the rest of us.  smile

You misread my post. A replace letter ( ) of [ ] with [ ] block would make it so that you only need one edit, not 42. Also, the wiki link method is also easier.

True, a block like that would make it simpler. The idea has merit, I'm simply against it. Well, it's up the the scratch team.

It would be nice to have both a relace letter ( ) of [ ] with [ ] AND 2D arrays, since bth are useful.  tongue

I really don't understand why you don't support it; if adding 2D arrays has no real cost, then it could be added and you could simply choose to use it or not. It would help those who use it and wouldn't hurt those who don't.


Newest project: Tunnel TEST ~http://blocks.scratchr.org/API.php?user=OverPowered&action=onlineStatus~ On my mind: Unicameralism

Offline

 

#86 2012-09-18 12:34:32

firedrake969_test
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: 2-D Arrays

Support.  I am learning lists, and 2-d ones would be amazingly helpful.


Alt of Firedrake969.

Offline

 

#87 2012-10-27 17:34:57

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: 2-D Arrays

Support. I need this.


........................................................................................................................................................................................................................................

Offline

 

#88 2012-11-24 13:28:07

gamer2012TEST
Scratcher
Registered: 2012-02-23
Posts: 5

Re: 2-D Arrays

I support ...but I think that a feature like this would've been announced already if it was to be in Scratch 2.0.

Offline

 

Board footer