Re: TIB: I NEED HELP


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

Re: TIB: I NEED HELP




> This is a a game that i am working on. I am just having trouble
> with one thing. The game is in a loop  until  you get hit 3 times,
> but the games just get slower and slower until i get an error 15
> memory. Is there any way i can get this to stop happening
> using a for, while, or reapeat statement? Any help would be
> greatly appreaciated.

You are violating one simple TI-Basic rule. NEVER EVER USE
A GOTO IN A LOOP OR CONDITION. And I don't see any End
statements. You have many infinite conditions. (Note: this letter
does not necessarily hold true for the 92.) You need to use End
before using a Goto. Here, let me show you.

Lbl LEFT
If M2-1==7
Then
Outpt(M1,M2,SHIP
Goto MOVE1
Else
M2-1/->/M2
Outpt(M1,M2,SHIP
Outpt(M1,M2+3," "
Goto MOVE1
Lbl MOVE1

Whenever you have an If statement, the calculator stores it in memory
so that it remembers it is in an If statement. You need to End out of it.
If you do not, the calculator will come to it again and add it to memory
again. It will get slower and slower until it runs out of memory. You
need to remove all of the Goto statements from inside the If statements
so that they cannot be rerun before reaching an End. If you need con-
ditional Goto statements, you have to use a one line If-Goto. You also
need to End all of the If statements that use Then/Else. Here, I fixed
the above snippet.

Lbl LEFT
If M2-1==7
Outpt(M1,M2,SHIP
If M2-1==7
Goto MOVE1
If M2-1<>7
Then
M2-1/->/M2
Outpt(M1,M2,SHIP
Outpt(M1,M2+3," "
End
Lbl MOVE1