Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
when making variables, what is the LIST/ARRAY?
Old
hydude777
Member
 
Status: Offline
Posts: 25
Join Date: Apr 2011
Default when making variables, what is the LIST/ARRAY? - 02-20-2012, 05:31 AM

what are those? how do I use them?
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 02-20-2012, 09:32 AM

A list is a group of variables that you can perform actions all at once with, or change them seperately, or independently, or whatever.

Say you had a group of 15 rabbits, and you wanted them all to move forward at once. You could do it by putting the movement commands in a do together, but that takes a while, and if you have more things for the rabbits to do it will take forever. That's where lists come in handy

Make a list of the rabbits, and then drag in "For all together" and have Items_From_Rabbits move forward, and you have now accomplished in one line of code what used to take 15. You can also use the "for all in order" to make them do the movement in order of the list, but that is more useful for checking something, say if you wanted to see if any of the rabbits were within 5 meters of the goal or whatnot, you could check them one by one that way.

That's lists. I learned arrays once upon a time, but I never used them, so I kind of forgot them.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.