Re: TIB: Re: I NEED HELP


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

Re: TIB: Re: I NEED HELP




I'm guessing you have a TI85...right?  This code will work on an 85...
Another thing you could do is instead of a goto, make a separate program.
So instead of "Goto MOVE", you could do MOVE (move is a program)

Here is an example:


This program makes it ad 1 and 1 100 times
---program name "program"
For(B,1,100
add
End

This program adds 1 and 1 then stores it to A

---program name "add"
1+1->A
Return
---



>-----Original Message-----
>From: NATHAN BROWNING <browningn@usa.net>
>To: ti-basic@lists.ticalc.org <ti-basic@lists.ticalc.org>
>Date: Thursday, March 12, 1998 5:44 PM
>Subject: 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.
>>
>>Thanks,
>>
>>Nate Browning
>>browningn@usa.net
>>
>>
>>SCRN is a string that displays the screen. It isn't listed in here but it
>doesnt have anything to do with my problem. It is declared under my intro
>screen. Also i have a high score screen that isnt here either. It is just
>the bit of code that i am having trouble with
>>
>>6/->/F1A
>>3/->/LIFE
>>0/->/SCORE
>>"<^>"/->/SHIP
>>8/->/M1:13/->/M2
>>9/->/E1A:3/->/E1
>>0/->/F1:9/->/E2A
>>ClLCD
>>Outpt(1,1,SCRN
>>Outpt(M1,M2,SHIP
>>
>>Lbl MOVE
>>If LIFE<=0:Goto DEAD
>>Outpt(M1,M2,SHIP
>>Outpt(5,1,SCORE
>>Outpt(8,3,LIFE
>>getKy/->/N
>>If N==24:Goto LEFT
>>If N==26:Goto RIGHT
>>If N==21:Goto FIRE
>>If N==11:Goto PAUS
>>If E1A>= 9 or E1==0
>>Goto EMA
>>If E1A-1==F1A+1 and E2A==F2A
>>Goto EHIT
>>GOTO FMOVE
>>
>>Lbl FMOVE
>>If F1A<= 1 or F1==0
>>Then
>>0/->/F1
>>Outpt(2,F2A," "
>
>
>>Goto ENEMY
>
>    This Is you r problem.  A goto in an If then.
>
>>Else
>>If F1A>=a
>>Outpt(F1A,F2A,"'"      <- There is an apostrophe between the quotes
>>Outpt(F1A+1,F2A," "
>>(F1A-1)/->/F1A
>>Goto ENEMY
>>Lbl ENEMY
>>If E1A==9
>>Then
>
>
>>Goto MOVE
>
>    And another
>
>>Else
>>If E1==1
>>Then
>>Outpt(E1A,E2A,"*"   <- The asterix is the enemy i use something different
>in the game itself
>>Outpt(E1A-1,E2A," "
>>(E1A+1)/->/E1A
>
>
>>Goto MOVE
>    another
>
>>
>>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
>
>    Again
>
>>Lbl MOVE1
>>If E1A==9
>>Then
>
>
>>Goto MOVE
>
>    Again
>
>>Else Outpt(E1A,E2A,"*"
>>Outpt(E1A-1,E2A," "
>>(E1A+1)/->/E1A
>>If F1A==0
>>Then
>
>
>>Goto MOVE
>
>    Again
>
>>Else
>>If F1>=1
>>Outpt(F1A,F2A,"'"  <-again there is an apostrope in here
>>Outot(F1A+1,F2A," "
>>(F1A-1)/->/F1A
>
>
>>Goto MOVE
>>Goto MOVE
>
>    Again
>
>>
>>Lbl RIGHT
>>If M2+3==21
>>Then
>>Outpt(M1,M2,SHIP
>
>
>>Goto MOVE2
>
>    Again
>
>>Else
>>M2+1/->/M2
>>Outpt(M1,M2,SHIP
>>Outpt(M1,M2-1," "
>
>
>>Goto MOVE2
>
>    Again
>
>>Lbl MOVE2
>>If E1A==9
>>Then
>
>
>>Goto MOVE
>
>    Again
>
>>Else
>>Outpt(E1A,E2A,"*"
>>Outpt(E1A-1,E2A," "
>>(E1A+1)/->/E1A
>>If F1A==0
>>Then
>
>
>>Goto MOVE
>
>    Again
>
>>Else If F1==1
>>Outpt(F1A,F2A,"'"   <-apostophe here too
>>Outpt(F1A+1,F2A," "
>>(F1A-1)/->/F1A
>
>
>>Goto MOVE
>>Goto MOVE
>
>    Again
>
>>Lbl FIRE
>>If F1==0
>>THen Goto FMA
>>Else
>
>
>>Goto FMOVE
>
>    Again
>
>>Lbl FMA
>>1/->/F1
>>M1-1/->/F1A
>>M2+1/->/F2A
>>Outpt(F1A,F2A,"'"  <-apostrophe
>
>
>>Goto FMOVE
>
>    Again
>
>>
>>Lbl EMA
>>If E2A==M2 or E2A==M2+1 or E2A==M2+2
>>Then
>>Outpt(M1,M2,"   "  <-three spaces
>>(LIFE-1)/->/LIFE
>>8/->/M1:13/->/M2
>>9/->/E1A:3/->/E1
>>0/->/F1:9/->/E2A
>
>
>>Goto MOVE
>
>    Again
>
>>Else Outpt(8,E2A," "
>>1/->/E1
>>2/->/E1A
>>int(rand x 14)+8/->/E2A
>>Goto FMOVE
>>
>>Lbl PAUS
>>Outpt(5,12, "paused"
>>Pause
>>Outpt(1,1,SCRN
>
>
>>Goto MOVE
>
>    Again
>
>>
>>Lbl EHIT
>>Outpt(E1A,E2A," "
>>9/->/E1A:3/->/E1
>>0/->/F1:9/->/E2A
>>(SCORE+10)/->/SCORE
>>Goto MOVE
>>
>>Lbl DEAD
>
>
>>End
>Is this to end the prog?  Shouldn't it be Stop?
>
>
>You didn't End and of your If Then's.  That is the proglem.
>What calc are you making this on?
>
>>