Why is my TI-84+ program running so slow?
I've programmed a simple pong program into my TI-84+. However, after the "ball" moves about 30 times, the program starts slowing, eventually to a point at which the game is close to unplayable. Can anyone offer a suggestion as to why this may be happening?
1- D #Direction
47- X #Ball Coords
26- Z #Ball Coords
26- U #User paddle
26- C #Computer paddle
0- F #User score
0- G #Comp score
Lbl M #Main
Pt-On(2,U,2) #User Paddle
Pt-On(2,U+3,2) #User Paddle
Pt-On(2,C,2) #Comp Paddle
Pt-On(2,C+3,2) #Comp Paddle
getKey- K #Key pressed
If K=25 #If up arrow pressed
Pt-Off(2,U,2) # remove paddle
U+5- U #raise paddle 5
Pt-Off(93,C,2) #remove comp paddle
If Z C+3 #adjust according to ball location
if Z C
If D=1 #directions
Pt-Off(X,Z,3) #remove ball
X+2- X #change ball coords
If Z =61 #change direction if ceiling or floor hit
If X =90
Goto CC #check to see if ball hit paddle or i
Okay, the greater than or less than signs won't go through. If you see something like Z+2- Z, there should be an arrow there (it's assignment in ti-basic)
About the Z C thing, there should be a less than or greater than sign there.
- Anonymous9 years agoFavorite Answer
That could be a memory leak. I've done a lot of programming with the TI-83+, and I think it has similar problems to the 84. As a program goes on, any variables you've saved somehow remain in memory even when they're overwritten by other ones. The garbage dump command fixes this, but it's annoying to do mid-game.
Edit: I guess the language for TI-84+ and TI-83+ are pretty different, but I think you are having the same problem that occurs on the 83. There's not much you can do about it as far as I'm aware. Maybe try rewriting your program in full TI-BASIC and install it as an app rather than a program. The full TI-BASIC has many more features than what is programmable from the TI's own interface.
- fadriLv 44 years ago
I took 2 years of calculus in severe college (AB and BC) and AP information, and that i only used a TI-80 3 plus, and to be fairly elementary that is all you bypass with for, notably if you're sturdy at math and do not opt for on your calculator to do each ingredient for you. That having been reported, with the options you've given, bypass with the TI-80 4 to confirm that you to computer screen it to any attempt that you're taking, no journey identifying to purchase an 89 then desiring yet another calculator for SAT/ACT/competitions.
- 9 years ago
EDIT: Eek! Those else ifs are not necessito!
Not sure if the If Z C is good either. I think it's checking if Z is 1 or greater (meaning true), then do C, which would be silly because that's like saying.
- Anonymous9 years ago
cuz u need a new card every now and then that is wut hapenz