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

#1 2009-06-07 11:06:52

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Lists: the future of huge projects?

I was just thinking... Lists are like a bunch of variables... so instead of 40 variables you can have 1 list. Instead of set variable to, you can have replace item (1) with:.
I just want to know what everybody thinks about this.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#2 2009-06-07 21:14:12

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Lists: the future of huge projects?

Yes, that's generally what they're used for. That's how a lot of projects operate, because you can't instantly make variables but you can instantly make items in a list, so you can have as many variables (items) as you want.

Offline

 

#3 2009-06-08 06:50:50

Mike_W
Scratcher
Registered: 2009-02-05
Posts: 100+

Re: Lists: the future of huge projects?

You can also do stuff like

row * 10 +column to build a 2 dimensional array from a  one dimensional - having 2d arrays would be better but my understanding arrays of arrays don't exist yet.

Offline

 

#4 2009-06-13 08:01:51

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Lists: the future of huge projects?

Mike_W wrote:

You can also do stuff like

row * 10 +column to build a 2 dimensional array from a  one dimensional - having 2d arrays would be better but my understanding arrays of arrays don't exist yet.

Arrays within arrays... Makes me think of the way I accidentally crashed scratch MULTIPLE TIMES. Make a variable endlessly add 10, then make another variable that is the first variable multiplied by 10 or so. Then make the first variable set to second variable times 99999 or something like that. 5 seconds later... SCRATCH CRASHED!!!

Edit: I know this isn't what you mean by array within array but... Put a list inside a list? Ok it might kinda be what you mean...

Last edited by juststickman (2009-06-13 08:02:47)


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#5 2009-06-13 08:57:35

Mike_W
Scratcher
Registered: 2009-02-05
Posts: 100+

Re: Lists: the future of huge projects?

What I mean is use multiplying variables to make the feel of a 2 dimensional array out of a one dimension array.

When I get some time I night do a sample project

Offline

 

#6 2009-07-12 02:31:47

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Lists: the future of huge projects?

The major advantage to arrays is that they are indexable and operate as portions of a set of values rather than a single one. You see, you cannot get, say, the score as it was 3 seconds ago with variables, as you don't know which one it was stored in. However, with lists, you just add to it every second, and take the third last.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

Board footer