Can someone please correct my code for the TI-83 BASIC programming language? Whenever you play my fighting game, after a while, it will say Error, memory.
Code:
Code:
:ClrHome
:AxesOff
:ZStandard
:ClrDraw
:Text(25,35,"LOADING")
:Shade(‾3,‾1)
:ClrHome
:Output(1,1,"A PROGRAM BY")
:Output(2,2,"TRISTAN SIRRICO")
:Pause
:ClrHome
:ClrDraw
:100→A
:100→B
:0→C
:0→D
:Lbl A
:Text(1,1,"YOUR HEALTH:")
:Text(1,75,A)
:Text(16,1,"OPPONENTS HEALTH:")
:Text(16,75,B)
:Text(32,1,"HIT WHERE?")
:Text(40,1,"HIGH=1 MID=2 LOW=3")
:Lbl B
:While 1
:0→Z
:randInt(1,3)→D
:If A≤0 or B≤0
:Then
:Goto C
:End
:If Z=0
:Then
:getKey→Z
:If Z≠92 and Z≠93 and Z≠94
:Then
:Goto B
:End
:If Z=92 and D=1
:Then
:ClrDraw
:Text(48,1,"BLOCKED")
:Goto A
:End
:If Z=92 and D=2
:Then
:randInt(1,20)→E
:A-E→A
:ClrDraw
:Text(48,1,"OPPONENT HITS")
:Goto A
:End
:If Z=92 and D=3
:Then
:ClrDraw
:randInt(1,20)→E
:B-E→B
:Text(48,1,"YOU HIT")
:Goto A
:End
:If Z=93 and D=1
:Then
:randInt(1,15)→E
:B-E→B:ClrDraw
:Text(48,1,"YOU HIT")
:Goto A
:End
:If Z=93 and D=2
:Then
:ClrDraw
:Text(48,1,"BLOCKED")
:Goto A
:End
:If Z=93 and D=3
:Then
:randInt(1,15)→E
:A-E→A
:ClrDraw
:Text(48,1,"OPPONENT HITS")
:Goto A
:End
:If Z=94 and D=1
:Then
:randInt(1,10)→E
:A-E→A
:ClrDraw
:Text(48,1,"OPPONENT HITS")
:Goto A
:End
:If Z=94 and D=2
:Then
:randInt(1,10)→E
:B-E→B
:ClrDraw
:Text(48,1,"YOU HIT")
:Goto A
:End
:If Z=94 and D=3
:Then
:ClrDraw
:Text(48,1,"BLOCKED")
:Goto A
:End
:Lbl C
:If A≤0 and B>0
:Then
:ClrHome
:Disp "HE WINS"," ","GAME OVER"
:Pause
:ClrHome
:ClrDraw
:AxesOn
:End
:If B≤0 and A>0
:Then
:ClrHome
:Disp "YOU WIN"
:Pause
:ClrHome
:ClrDraw
:AxesOn
:End
:If A≤0 and B≤0
:Then
:ClrHome
:Disp "TIE"
:Pause
:ClrHome
:ClrDraw
:AxesOn
:End