Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Joshuasm32 on February 09, 2014, 11:30:29 pm

Title: Slow Down a Program
Post by: Joshuasm32 on February 09, 2014, 11:30:29 pm
I am a newb at Axe Parser, and was wondering how to slow a program down...  I have already used ExprOff.  What is the best method to do so, without random code that takes up bytes?
Title: Re: Slow Down a Program
Post by: pimathbrainiac on February 09, 2014, 11:38:13 pm
You could have a meaningless interrupt going on in the background that just increments a counter variable. This has actually never occurred to me before. I wonder why you need to slow down a program, though?
Title: Re: Slow Down a Program
Post by: Joshuasm32 on February 09, 2014, 11:40:46 pm
It is a very basic program, and some of the graphics are too hard to see, not to mention the fact that one keypress moves a tank across the screen.  What exactly do you mean with the breaks?  (Like I said, I am a total newb)
Title: Re: Slow Down a Program
Post by: pimathbrainiac on February 09, 2014, 11:49:06 pm
Breaks? I said interrupts. They are routines that interrupt the execution of a program based on the internal timers, and continue where the program left off.

That said, an easy way is that for the things that move, you multiply the position variable by a number and increment when you increment by a smaller number than the scaler constant. When you display, you just divide the position variable by the scaler constant.

For example:
Code: [Select]
2*5->X
2*5->Y

X+[keypress]->X
Y+[keypress]->Y

Pt-On(X/2,Y/2,[Ptr])
Title: Re: Slow Down a Program
Post by: Runer112 on February 10, 2014, 12:23:50 am
I would recommend using Pause x. x=1800 corresponds to approximately one second on a calculator running at 6MHz (the default), or x=4500 corresponds to approximately one second on a calculator running at 15MHz (if you've used Full on a 15MHz-capable calculator).
Title: Re: Slow Down a Program
Post by: Joshuasm32 on February 10, 2014, 12:31:03 am
Thank you!  That is a great idea...
Title: Re: Slow Down a Program
Post by: Matrefeytontias on February 10, 2014, 12:59:46 am
Pimath went a little too far on this one :P I hope you're not using imterrupts to slow down a program ... Such a waste.
Title: Re: Slow Down a Program
Post by: pimathbrainiac on February 10, 2014, 01:00:52 am
Matref: see my second post.

No interrupts :P