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.
Offline
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
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
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)
Offline
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
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.
Offline