[TIB] Re: Question


[Prev][Next][Index][Thread]

[TIB] Re: Question




I would have liked to have this function for quite a few reasons, but here 
are the most recent ones. Right now I'm trying to write that snake game, the 
one where the snake is slithering around the screen trying to get the 
apples. I haven't really been able to do this because the only way I could 
see myself doing it would involve writing a whole sequence of if then 
statements, each for one segment of the snake. This list thing seems like it 
would work pretty well for this, but I would also need to be able to refer 
to these variables after assigning them. I think I'll assume that you can do 
all of these things using a list, so I think I'll just read up on lists a 
little more.

Thank you -Jules






>From: CJ Wallace <WCylan@gmx.net>
>Reply-To: ti-basic@lists.ticalc.org
>To: ti-basic@lists.ticalc.org
>Subject: [TIB] Re: Question
>Date: Thu, 07 Nov 2002 22:28:32 -0500
>
>
>Ah, I see what you want. I think that a list would do exactly what you
>want. Basically, a list is a bunch of variables that have an index
>[which is what you were trying to use "X" to represent].
>
>If you know exactly how many different variables that you want, then
>your code should look like this:
>
>:[number of variables you want]->dim(L1)
>:[begin loop]
>:X+1->X
>:Y->L1(X)
>:[end loop]
>
>Do NOT use Goto / Lbl loops in TIBasic. These commands are really poorly
>suited for looping, as they lead to memory leaks and other problems, not
>to mention they are much slower than a Repeat( or For(. In general, try
>to avoid using Goto / Lbl commands in TIBasic at all costs, they really
>aren't very well implemented, and are often used improperly.
>
>-c.j.w.
>


_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail