Help with my basic TI-84 Plus CE (OS 5.8.0.002) program code please, the c compiler didnt work for my old ahh hardware, so I make a mostly working game in basic.

Key requirements:
Every line must begin with “:” (no blank lines or missing colons).
NO Then/End statements anywhere in the code — use only If statements (my calculator throws syntax errors with any Then/End blocks).
All negative numbers must be written as 0-minus style (e.g., 0-100 instead of -100, 0-20 instead of -20, etc.).
Avoid domain errors at all costs, especially division by zero or very large/small numbers early in the game.
No token or syntax errors — code must run cleanly on a real TI-84 Plus CE.

Main bug to fix in the provided code:
Locks onto planes clearly outside of radar cone

My code :calc: :


Code:

:ClrHome
:Output(1,1,"WARTHNDR")
:Output(2,1,"F-15 vs MiG-25")
:Output(4,1,"DEFEND AMERICA")
:Output(6,1,"UP/DOWN: AIM")
:Output(7,1,"ENTER: FIRE")
:Output(8,1,"CLEAR: QUIT")
:Output(10,1,"PRESS ENTER")
:0→K
:Repeat K=105
:getKey→K
:End
:ClrDraw
:AxesOff
:GridOff
:LabelOff
:0→Xmin
:320→Xmax
:0→Ymin
:240→Ymax
:280→R
:120→S
:0→A
:40→W
:0→B
:0→C
:0→E
:0→F
:0→V
:0→M
:0→N
:0→P
:0→Q
:0→L
:0→T
:0→G
:0→U
:0→D
:0→H
:0→I
:0→Z
:0→Y
:Repeat K=45 or B≥3 or C≥3
:getKey→K
:If K=25:A+15→A
:If K=34:A-15→A
:If A>100:100→A
:If A<(0-100):(0-100)→A
:T+1→T
:0→U
:If V=0 and T>8 and rand>0.7:1→U
:If U=1:20→E
:If U=1:30+int(rand*180)→F
:If U=1:1→V
:If U=1:0→T
:If V=1:E+4→E
:0→U
:If V=1 and E>285:1→U
:If U=1:B+1→B
:If U=1:0→V
:If U=1:0→E
:If U=1:0→F
:If U=1:0→T
:0→D
:0→H
:If V=1 and E>110 and E<275 and abs(R-E)>10:1→H
:If H=1 and abs(R-E)>50:(S+A+W-F)*((R-E)/(R-105))+F→G
:If H=1 and abs(R-E)≤50:F→G
:If H=1 and G>(S+A-W-2) and G<(S+A+W+2):1→D
:If H=1:0→H
:0→Z
:If K=105 and L=0 and V=1 and D=1:1→Z
:If Z=1:R→M
:If Z=1:S+A→N
:If Z=1:E→P
:If Z=1:F→Q
:If Z=1:1→L
:If Z=1:1→I
:0→H
:If L=1 and abs(P-M)>4:1→H
:If H=1 and P>M:18→G
:If H=1 and P<M:(0-18)→G
:If H=1:M+G→M
:If H=1:0→H
:If L=1 and abs(Q-N)>4:1→H
:If H=1 and Q>N:16→G
:If H=1 and Q<N:(0-16)→G
:If H=1:N+G→N
:If H=1:0→H
:0→U
:If L=1 and (M<22 or M>318 or N<2 or N>238):1→U
:If U=1:0→L
:If U=1:0→I
:0→U
:If L=1 and V=1 and M<E+5:1→U
:If U=1:0→L
:If U=1:0→I
:0→U
:If V=1 and L=1 and abs(M-E)<22 and abs(N-F)<22:1→U
:If U=1:C+1→C
:If U=1:0→V
:If U=1:0→L
:If U=1:0→I
:If U=1:0→E
:If U=1:0→F
:If U=1:0→T
:ClrDraw
:Line(R-10,S,R+10,S)
:Line(R,S-10,R,S+10)
:S+A+W→J
:If J<5:5→J
:If J>235:235→J
:Line(R,S,20,J)
:S+A-W→J
:If J<5:5→J
:If J>235:235→J
:Line(R,S,20,J)
:If V=1 and D=0 and F>10 and F<230:Line(E-6,F,E+6,F)
:If V=1 and D=0 and F>10 and F<230:Line(E,F-6,E,F+6)
:If V=1 and D=1 and F>10 and F<230:Line(E-8,F-8,E+8,F-8)
:If V=1 and D=1 and F>10 and F<230:Line(E+8,F-8,E+8,F+8)
:If V=1 and D=1 and F>10 and F<230:Line(E+8,F+8,E-8,F+8)
:If V=1 and D=1 and F>10 and F<230:Line(E-8,F+8,E-8,F-8)
:If L=1 and I=1 and M>4 and M<316 and N>4 and N<236:Pt-On(M,N)
:If L=1 and I=1 and M>4 and M<316 and N>4 and N<236:Pt-On(M+4,N)
:If L=1 and I=1 and M>4 and M<316 and N>4 and N<236:Pt-On(M,N+4)
:If L=1 and I=1 and M>4 and M<316 and N>4 and N<236:Pt-On(M+4,N+4)
:If L=1 and I=1 and M>4 and M<316 and N>4 and N<236:Pt-On(M+2,N+2)
:If L=1 and I=1 and M>4 and M<316 and N>4 and N<236:Pt-On(M+1,N+1)
:If L=1 and I=1 and M>4 and M<316 and N>4 and N<236:Pt-On(M+3,N+3)
:Text(­1,1,1,"BREACHES:",B)
:Text(­1,20,1,"KILLS:",C)
:End
:ClrHome
:Output(4,5,"GAME OVER")
:If B≥3:Output(6,3,"AMERICA LOST")
:If C≥3:Output(6,4,"VICTORY!")
:Output(8,2,"FINAL KILLS:")
:Output(8,14,C)
:Output(9,2,"BREACHES:")
:Output(9,12,B)
:0→K
:Repeat K=105
:getKey→K
:End
:ClrHome
Turn off smiles, there are 😎 all over your code
For reference, you can use ti-planet.org's project builder to make and build C/ASM projects online. So if you are going to make it in C, I would do it there. I believe that it is not restricted by your hardware. Speaking of hardware, what is the hardware that you are using?

Also, I have a few quick questions for you: Why do you need your negative numbers written in a form like -X = 0-X, and what do you mean you get syntax errors using Then/Else? If your calculator just gives you syntax errors when using them, you either should reinstall your OS, or you are just coding plain wrong.
Here's a simple example of an If/Then/Else Statement. If you do not follow similar formatting, that would explain why it doesn't work.

Code:

If A<B
Then
Disp "Hello, World"
A+1→B
Else
Disp "Goodbye, World"
End
It just only displayed goodbye world...my calc is really whack, I troubbleshooted for a few days and it always ended with that problem...I just as confused as everyone else. I was so stumped and resorted to asking claude ai and it also came to that conclusion.-weird
Here, please try this. It will test if your calculator can do any if/then/end statements correct. Make sure to get all of the arguments from the Prgm menu.

Code:

1→A
If A=1
Then
Disp "Success"
Pause
Stop
End

Tell me what happens when you execute this.
error:undefined, goto button sent cursor to before the u in pause on line 5. I even reinstalled the software and it didn't work. I switched to my windows 11 pc at school to send it and it still no workie.
You didn't type the pause command correctly; it must have a trailing space ("Pause "). If you omit it, then your program contains the individual tokens P, a, u, s, and e.
I intended him to type it on-calc. If it is being accessed through the PRGM button, and scrolling to Pause, there should be no problems.
You need to type all of the code on the calculator, and access all of the tokens through the PRGM menu for it to properly work. Please do not just paste the code I wrote into TI Connect CE, and transfer it to the calculator.
I tried that too (typing it), still failed. Oh well...maybe I should cut my losses since ppl arent revising my missile logic. At least my code didn't crash on my calc. 😸
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement