I need help optimizing my amateur TI-83+ Basic Pokemon game, but due to the fact that I don't have a cable for computer uplink anymore I will need to type and post the coding for it manually so there may be typos from where I typed it on here. All text in bold is meant to say what character should go there because either I am too lazy to find the computer version or there isn't one. Also, I am hoping to keep it all on one program with no subprograms.
At the moment this program takes up 9,540 bytes, but I am hoping to get it reduced to 7,500 bytes while still retaining all of its features.
For reference:
L= lvl of active pkmn | M= exp pkmn 2 | V= hp pkmn 3 | R= map identify number |
Q= hp of active pkmn | P= hp pkmn 2 | J= money | X= horizontal position |
Z= exp of active pkmon | E= lvl pkmn 3 | I= pkballs | Y= vertical position |
H= Lvl pkmn 2 | K= exp pkmn 3 | T= potions | U= whether or not in battle |
:1→X
:ClrDraw
:" "→Str1
:Text(-1,8,20,"P KeM n"
:Text(-1,11,26,"º" //these were used to make there appear to be lowercase o's in PoKeMon
:Text(-1,11,50,"º"
:Text(16,25,"GRAY V1.0"
:Text(50,1,"PROGRAMMER:"
:Text(56,10,"YHCNARF"
:Text(28,28,"LOADING"
:For(X,1,94
:" "+Str1→Str1
:Pxl-On(36,X
:Pxl-On(37,X
:End
:Text(28,23,"PRESS ENTER"
:Pause
:ClrDraw
:8→X
:2→Y
:SetUpEditor ITEMS,POKE1,POKE2,POKE3,MAP,MB,LOC
:ClrHome
:Menu("POKEMON GRAY","CONTINUE",LS,"NEW GAME",AZ)
:Lbl LS
:Output(8,1,"LOADING"
:LLOC(1→Z
:LLOC(2→Y
:LLOC(3→R
:LPOKE1(1→L
:LPOKE1(2→Z
:LPOKE1(3→Q
:LPOKE2(1→H
:LPOKE2(2→M
:LPOKE2(3→P
:LPOKE3(1→E
:LPOKE3(2→K
:LPOKE3(3→V
:LITEMS(1→J
:LITEMS(2→I
:LITEMS(3→T
:SetUpEditor
:Archive LLOC
:Archive LITEMS
:Output(8,8,"."
:Archive LPOKE1
:Output(8,9,"."
:Archive LPOKE2
:Output(8,10,"."
:Archive LPOKE3
:Output(8,1," "
:Goto LM
:Lbl AZ
:Output(8,1,"CONFIGURING"
:1→R
:5→L
:784→Z
:25→Q
:0→H
:0→M
:0→P
:0→E
:0→K
:0→V
:100→J
:5→I
:2→T
:{L,Z,Q}→LPOKE1
:{H,M,P}→LPOKE2
:{E,K,V}→LPOKE3
:{J,I,T}→LITEMS
:{X,Y,R}→LLOC
:SetUpEditor
:Archive LLOC
:Output(8,12,"."
:Archive LITEMS
:Archive LPOKE1
:Output(8,13,"."
:Archive LPOKE2
:Output(8,14,"."
:Archive LPOKE3
:" "→Str3
:Str3→Str5
:Str5→Str7
:Lbl θθ
:ClrHome
:" "→Str0
:Str0→Str9
:Menu("POKeMON","SQUIRTLE",SQ,"BULBASAUR",BS,"CHARMANDER",CM,"Stop",Q)
:Lbl Q
:ClrHome
:Output(8,1,"SAVING"
:SetUpEditor POKE1,POKE2,POKE3,ITEMS,LOC
:{L,Z,Q}→LPOKE1
:{H,M,P}→LPOKE2
:{E,K,V}→LPOKE3
:{J,I,T}→LITEMS
:{X,Y,R}→LLOC
:SetUpEditor
:Archive LITEMS
:Archive LLOC
:Output(8,7,"."
:Archive LPOKE1
:Output(8,8,"."
:Archive LPOKE2
:Output(8,9,"."
:Archive LPOKE3
:prgmCREDITS //Basically a program that just deletes all variables and resets calculator settings I use it to clean up after all my games
:Lbl SQ
:"SQUIRTLE"→Str3
:"WATER GUN"→Str5
:"BITE"→Str4
:If U≠0
:Goto PS
:Goto P1
:Lbl BS
:"BULBASAUR"→Str3
:"VINE WHIP"→Str5
:"TACKLE"→Str4
:If U≠0
:Goto PS
:Goto P1
:Lbl CM
:"CHARMANDER"→Str3
:"EMBER"→Str5
:"SCRATCH"→Str4
:If U≠0
:Goto PS
:Lbl P1
:1→F
:ClrHome
:Lbl LM
:ClrHome
:Output(8,1,"LOADING MAP"
:If R=0
:{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,0,4,0,0,0,3,6,6,6,6,4,0,1,1,5,5,5,5,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1→MB
:If R=0
:Then
:For(A,1,6
:2→LMB(A+24)
:End
:End
:If R=2
:Then
:For(A,1,3
:1→LMB(8+16(A-1))
:End
:End
:If R=10
:Then
:3→LMB(5)
:4→LMB(12)
:For(A,1,2
:3→LMB(6+16(A-1))
:4→LMB(11+16(A-1))
:End
:End
:If R≥6 and R≤10
:Then
:For(A,1,3)
:3→LMB(7+16(A-1))
:If R≠10
:4→LMB(9+16(A-1))
:If R=10
:4→LMB(R+16(A-1))
:End
:End
:If R≤2 and R≠0
:0→LMB(16)
:If R=2 or R=4
:0→LMB(1)
:If R=3 or R=0 or R=5
:0→LMB(56)
:For(W,1,4
:For(A,1,16
:Output(W,A,sub(" θπ[]-(mini plus sign thingy)*O:=",1+LMAP(A+16(W-1)),1
:End
:End
:For(W,1,4
:For(A,1,16
:Output(W+4,A,sub(" θ=][",1+LMB(A+16(W-1)),1
:End
:End
:Output (Y,X,"π"
:Lbl P
:While 1
:If randInt(1,8)=8 and R=2 and Y≤4
:Goto WP
:getKey→G
:While G=0
:getKey→G
:End
:Output(Y,X," "
:If R=2 and Y≤4
:Output(Y,X,"*"
:If G=24 and (X≠2 or Y=5 and (R=2 or R=4)) and not(R≥6 and R≤9)
:X-1→X
:If G=25 and (Y≠2 or (R=1 or R≥4) and X=8 or R=1 and X=13 or X=9 and R=10)
:Y-1→Y
:If G=26 and (X≠15 or Y=5 and R≤2) and not(R≥6 and R≤9)
:X+1→X
:If G=34 amd (Y≠7 or (R=3 or R=5 or R=0) and X=8)
:Y+1→Y
:If Y=1 and R≥6 and R≤9 or X=15 and Y=2R and R≤2
:Then
:Y+1→Y
:If R≥6 and R≤9
:7→Y
:Goto F1
:End
:If R=2 and X=8 and Y≥3 or (R=5 or R=0) and Y≤3 and X≤5 and X≠3 or R=3 and X≠8 and Y=3 or R=10 and (X=7 or X=R or X=8 and Y=4) or R=0 and X≥9 and X≤14 and (Y=4 or Y=6 or Y=2)
:Then
:If G=25
:Y+1→Y
:If G=24
:X+1→X
:If G=26
:X-1→X
:If G=34
:Y-1→Y
:End
:If G=105
:Goto M
:Lbl MB
:Output(Y,X,"π"
:If R=0 and Y=4 and X=3
:Goto TI
:If Y=3 and (R=3 or X=3 and R=5)
:Then
:4→Y
:Goto PC
:End
:If Y=1
:Then
:7→Y
:If R=1 and X=8
:3→R
:If R=10
:11→R
:If R=1
:8→X
:If R=1
:0→R
:If R>3
:R+1→R
:Goto LM
:End
:If X=16
:Then
:2→X
:2R→R
:Goto LM
:End
:If X=1
:Then
:R/2->R
:15→X
:Goto LM
:End
:If Y=8
:Then
:If Q≤0
:Then
:7→Y
:Output(8,8," "
:Output(7,8,"π"
:Goto P
:End
:2→Y
:If R=3
:1→R
:If R=5
:4→R
:If R=0
:13→X
:If R=0
:1→R
:Goto LM
:End
:End
:Lbl TI
:ClrHome
:Disp "BUY:"
:2→A
:Output(2,2,"POKEBALL:100"
:Output(3,2,"POTION:200"
:Output(4,2,"EXIT"
:Output(A,1,">"
:While not(G=105 and A=4)
:getKey→G
:Output(1,9,"POKE:"
:Output(1,14,J
:While G=0
:getKey→G
:End
:Output(A,1," "
:If G=25 and A>2
:A-1→A
:If G=34 and A<4
:A+1→A
:Output(A,1,">"
:If G=105 and A=2 and J≥100 and I<99
:Then
:J-100→J
:I+1→I
:End
:If G=105 and A=3 and J≥200 and T<99
:Then
:J-200→J
:T+1→T
:End
:End
:Y+1→Y
:Goto LM
:Lbl M
:1→U
:Lbl VW
:ClrHome
:Menu("Menu(","Party",PS,"INVENTORY",IV,"SAVE",Q,"Return",LM)
:Lbl IV
:ClrHome
:1→B
:Output(1,1,"INVENTORY:"
:Output(2,2,"POKEBALLS( )"
:Output(2,12,I
:Output(3,2,"POTIONS( )"
:Output(3,10,T
:Output(4,2,"BACK"
:Lbl II
:0→G
:While G≠105
:Output(B+1,1,">"
:getKey→G
:While G=0
:getKey→G
:End
:Output(B+1,1," "
:If G=25 and B>1
:B-1→B
:If G=34 and B<3
:B+1→B
:End
:If B=1
:Then
:If I>0
:Goto CT
:End
:If B=2
:Then
:If T>0
:Goto UI
:End
:If B≠3
:Goto II
:If U=1
:Goto VW
:If U≤5 and U≠4
:Goto B
:Lbl UI
:Menu("USE ON:",Str3,I1,Str0,I2,Str9,I3,"BACK",IV)
:Lbl I1
:Q+20→Q
:If Q≥10+3L
:10+3L→Q
:Goto I4
:Lbl I2
:If P≤0 or Str0=" "
:Goto UI
:P+20→P
:If P≥10+3H
:10+3H→P
:Goto I4
:Lbl I3
:If V≤0 or Str9=" "
:Goto UI
:V+20→V
:If V≥10+3E
:3E+10→V
:Lbl I4
:T-1→T
:If U≠1 and U≠4
:Goto YZ
:ClrHome
:Output(4,1,"HEALTH RESTORED"
:Pause
:Goto IV
:Lbl WM
:If U=1
:X→F
:If U=1
:Y→S
:ClrDraw
:Text(0,1,Str3
:Text(6,1,Str4
:If L≥7
:Text(12,1,Str5
:Text(18,1,"HP:",Q,"/",10+3L
:Text(24,1,"LVL:",L
:Text(30,1,"EXP:",Z,"/",L(L+10)²
:Pause
:ClrDraw
:If U=1
:F→X
:If U=1
:S→Y
:Lbl PS
:ClrHome
:Menu("Party",Str3,WM,Str0,1,Str9,2,"Return",M9)
:Lbl M9
:If Q≤0 and R≠3
:Goto PS
:If U=1
:Goto VW
:If U≠4 and U≤5
:goto WD
:Lbl 1
:If Str0=" "
:Goto PS
:Menu(Str0,"SWITCH",1A,"RELEASE",1B,"Return",PS)
:Lbl 1B
:If U>1
:Goto 1
:" "→Str0
:Goto PS
:Lbl 1A
:If P≤0
:Goto 1
:Q→G
:P→Q
:G→P
:L→G
:H→L
:G→H
:Z→G
:M→Z
:G→M
:Str3→Str8
:Str0→Str3
:Str8→Str0
:Goto NM
:Lbl 2
:If Str9=" "
:Goto PS
:Menu(Str9,"SWITCH",2A,"RELEASE",2B,"Return",PS)
:Lbl 2B
:If U>1
:Goto 2
:" "→Str9
:Goto PS
:Lbl 2A
:If V≤0
:Goto 2
:Q→G
:V→Q
:G→V
:L→G
:E→L
:G→E
:Z→G
:K→Z
:G→K
:Str3→Str8
:Str9→Str3
:Str8→Str9
:Lbl NM
:If Str3="SQUIRTLE"
:Goto SQ
:If Str3="CHARMANDER"
:Goto CM
:If Str3="BULBASAUR"
:Goto BS
:"TACKLE"→Str4
:If L≥16 and L≤35 and Str3≠"BUTTERFREE" or Str3="METAPOD" or Str3="RAICHU" or Str3="RATICATE"
:Goto EP
:If L≥36 or Str3="BUTTERFREE"
:Goto E9
:If Str3="PIDGEY"
:"GUST"→Str5
:If Str3="GEODUDE"
:"ROCK THROW"→Str5
:If Str3="CATERPIE"
:"STRINGSHOT"→Str5
:If Str3="RATTATA"
:"SCRATCH"→Str5
:If Str3="PIKACHU"
:"THUNDER BOLT"→Str5
:Goto PS
:Lbl FE
:If R=6
:Then
:20→C
:70→W
:"DEWGONG"→Str6
:"ICE BEAM"→Str7
:If U=5
:"LAPRAS"→Str6
:If U=3
:"AURORA BEAM"→Str7
:End
:If R=7
:Then
:30→C
:100→W
:"MACHOKE"→Str6
:"STRENGTH"→Str7
:If U=5
:"ROCK SLIDE"→Str7
:If U=5
:"RHYDON"→Str6
:End
:If R=8
:Then
:40→C
:130→W
:"HYPNO"→Str6
:"PSYCHIC"→Str7
:If U=5
:"GENGAR"→Str6
:If U=5
:"FAINT ATTACK"→Str7
:End
:If R=9
:Then
:50→C
:160→W
:"GYARADOS"→Str6
:"DRAGON RAGE"→Str7
:If U=5
:"DRAGONITE"→Str6
:If U=5
:"HYPER BEAM"→Str7
:End
:If R=10
:Then
:60→C
:190→W
:"PIDGEOT"→Str6
:"FLY"->Str7
:If U=5
:"ALAKAZAM"→Str6
:If U=5
:"PSYCHIC"→Str7
:End
:Goto B
:Lbl F1
:3→U
:X→F
:Y→S
:1→A
:ClrDraw
:If R≥6
:Goto FE
:Lbl FT
:randInt(1,4)→W
:"PSYDUCK"→Str6
:"PSYCHIC"→Str7
:If W=2
:Then
:"MAGICARP"→Str6
:"SPLASH"→Str7
:If L>29
:"GYARADOS"→Str6
:If L>29
:"SURF"→Str7
:End
:If W=3
:Then
:"TANGELA"→Str6
:"VINE WHIP"→Str7
:End
:If W=4
:Then
:"ONIX"→Str6
:"ROCK HORN"→Str7
:End
:L→C
:10+3C→W
:Goto B
:Lbl WP
:2→U
:X→F
:Y→S
:randInt(1,L)→W
:"RAICHU"→Str6
:"THUNDERBOLT"→Str7
:If W<16
:"PIKACHU"→Str6
:If W≤8
:Then
:"GEODUDE"→Str6
:"ROCK THROW"→Str7
:End
:If W≤6
:Then
:"PIDGEY"→Str6
:"GUST"→Str7
:End
:If W≤4
:Then
:"RATTATA"→Str6
:"SCRATCH"→Str7
:End
:If W≤2
:Then
:"CATERPIE"→Str6
:"STRING SHOT"→Str7
:End
:W→C
:10+3C→W
:ClrDraw
:1→A
:Lbl B
:While 1
:Text(0,0,W," "
:Text(0,60,Str6," "
:Text(39,65,"ººº" //there is some other circle mark besides degree sign that fits here
:If P≤0 or Str0=" "
:Pxl-On(43,70 // these would fill in those circles to represent that pokemon not available
:If V≤0 or Str9=" "
:Pxl-On(43,74
:Text(45,0,Str3," "
:Text(45,40,"LVL:",L
:Text(45,65,Q,"/",10+3L," "
:Text(57,70," "
:Text(51,0," "
:Text(57,0," "
:Text(51,70," "
:If A=2 or A-4 or A=6
:Then
:57→G
:Else
:51→G
:End
:If A=3 or A=4 or A=7
:Then
:Text(G,70,">"
:Else
:Text(G,0,">"
:End
:If A≥5
:Then
:Text(51,7,"SWAP"
:Text(57,7,"ITEMS"
:Text(51,75,"BACK"
:Else
:Text(51,7,Str4
:If L>7
:Text(57,7,Str5
:Text(51,75,"MENU"
:Text(57,75,"RUN"
:End
:getKey→G
:While G=0
:getKey→G
:End
:Lbl 63
:If G=25 and A≠1 and A≠5
:A-1→A
:If G=34 and A≠4 and A≠7
:A+1→A
:If G=24 and A>2 and A≠5 and A≠6
:A-2→A
:If G=26 and (A≤2 or A=5)
:A+2→A
:If L<7 and A=2
:Then
:If G=34
:4→A
:If G=24
:1→A
:End
:If G≠105
:End
:Text(51,0,Str1
:Text(57,0,Str1
:If A=3
:Then
:5→A
:Goto 99
:End
:If A=7
:Then
:1→A
:Goto 99
:End
:If A=6
:Goto IV
:If A=5
:Goto 26
:If A≠4
:Goto B3
:Text(51,0,Str1
:Text(57,0,Str1
:If U=3 or U=5
:Then
:Text(51,0,"CAN'T RUN"
:Pause
:Text(51,0,Str1
:Goto 99
:End
:Text(51,0,"YOU RUN AWAY"
:Pause
:ClrHome
:F→X
:S→Y
:Goto LM
:Lbl B3
:If A=1
:Text(51,0,Str3," USED ",Str4
:If A=2
:Then
:Text(51,0,Str3," USED ",Str5
:W-randInt(1,5)→W
:End
:W-round(L/2,0)→W
:If W≤0
:0→W
:Text(0,0,W," "
:Pause
:If W≤0
:Then
:Text(51,0,Str1
:Text(51,0,Str6," FAINTED"
:Pause
:Text(1,0,Str1
:Goto W
:End
:Goto B2
:Lbl YZ
:Text(51,0,"HEALTH RESTORED"
:Text(45,65,Q,"/",10+3L," "
:Pause
:Text(51,0,Str1
:Lbl B2
:Text(45,0,Str3
:Text(0,60,Str6
:Text(0,0,W
:Text(51,0,Str1
:Text(57,0,Str1
:If randInt(1,2)=2
:Then
:Text(51,0,Str6," USED TACKLE"
:Else
:Q-randInt(1,5)→Q
:Text(51,0,Str6," USED ",Str7
:End
:Q-round(C/2,0)→Q
:If Q≤0
:0→Q
:Text(45,65,Q,"/",10+3L," "
:Pause
:Text(51,0,Str1
:If Q>0
:Goto 99
:If Q≤0
:Goto 26
:Lbl WD
:1→A
:Goto B2
:Lbl CT
:I-1→I
:Text(51,0,"GO POKEBALL"
:0→G
:Text(24,45,"θ"
:For(G,0,40
:End
:If randInt(1,W)≠1 or Str0≠" " and Str9≠" " or U=3 or U=5
:Then
:Text(51,0,Str1
:Text(24,45,"C"
:If U=3 or U=5
:Then
:Text(51,0,"DON'T STEAL"
:Else
:Text(51,0,"AW IT GOT OUT"
:End
:Pause
:Text(24,45," "
:Text(51,0,Str1
:Goto B2
:Else
:StorePic1
:If Str0=" "
:Then
:Str6→Str0
:C→H
:((C-1)+10)²(C-1)→M
:W->P
:Goto 98
:Else
:C→E
:((C-1)+10)²(C-1)→K
:W→V
:Str6→Str9
:Lbl 98
:RecallPic1
:Text(51,0,Str1
:Text(51,0,"YES CAUGHT IT"
:F→X
:S→Y
:Pause
:ClrHome
:Goto LM
:Lbl 99
:End
:End
:Goto B
:Lbl W
:If U=5
:Then
:J+C→J
:Text(51,0,Str1
:Text(51,0,"GAINED ",C," pºKe"
:Pause
:Text(51,0,Str1
:End
:Z+(5+C)²→Z
:Text(51,0,Str3," GAINED ",(5+C)²," EXP"
:Pause
:Text(51,0,Str1
:Text(57,0,Str1
:If U=3
:Then
:5→U
:If R≥6
:Goto FE
:Goto FT
:End
:If R≥6 and R≤9
:R+1→R
:F→X
:S→Y
:If Z<L(L+10)²
:Goto LM
:Text(51,0,Str3," LEVELED UP"
:Pause
:Text(51,0,Str1
:L+1→L
:10+3L→Q
:4→U
:If L=16 and Str3≠"METAPOD" or L=10 and Str3="CATERPIE" or L=36 and Str3≠"RAICHU" and Str3≠"RATICATE" and Str3≠"BUTTERFREE" or Str3="METAPOD" and L=20
:Goto EV
:Lbl X9
:Lbl X8
:Goto LM
:Lbl PC
:10+3L→Q
:If Str0≠" "
:10+3H→P
:If Str9≠" "
:10+3E→V
:Output(2,9,"HEALED"
:Pause
:Output(2,9," "
:If R=3
:Then
:Output(3,8,"O"
:Output(4,8,"π"
:End
:If R=5
:Then
:Output(3,3,"O"
:Output(4,3,"π"
:End
:Goto P
:Lbl EV
Alright almost got it fully up. Only one more section of coding to add