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

#1 2012-06-23 12:56:51

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

Allowing access to nested arrays.

I think Scratch's list system is good, but it doesn't allow for much in the way of multidimensional arrays: currently, to access a single item in a "3D" nested array structure requires you load each dimension into another list and then load each item into another and so forth, I propose this modification to list blocks:

(item (1 v) of (item (1 v) of [array v]))

replace item (1 v) of (item (1 v) of [array v]) with []
I recently made a game that could have benefited greatly from these and I think it would make many projects using arrays like this to be greatly improves, both in play speed (it takes time to load items into lists through iteration) and in simplicity.

EDIT:I just made a CSV opener and it took 3 lists and 2 variables, not a very efficient way of accessing stored data like this

Last edited by zammer990 (2012-06-24 11:56:28)


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

Offline

 

#2 2012-06-23 19:12:50

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Allowing access to nested arrays.


http://trinary.tk/images/signature_.php

Offline

 

#3 2012-06-24 11:55:47

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

Re: Allowing access to nested arrays.

Yea, that's what the topic's about but I'm just suggesting a modification to existing blocks, rather than a new kind of data.


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

Offline

 

#4 2012-06-25 02:32:18

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Allowing access to nested arrays.

Oh, I see.


http://trinary.tk/images/signature_.php

Offline

 

Board footer