Re: TIB: Goto's


[Prev][Next][Index][Thread]

Re: TIB: Goto's




Christopher Robin MacDougald wrote:
> 
> Attn.: Jody,
>         I actually only use goto to maneuver between games within my program I
> use 1 program to put three games in it. EX: Arcade Pack, etc. You get
> the point the other place that I use a goto is fast exiting w/in a
> repeat loop. I also nest lot's of loops w/in each other, repeat loops on
> the 85 seem to run a whole lot faster than any of the other loops. Since
> you have an 83 you should be able to run my 82 programs that I've
> written. In case you missed the url before it's:
> http://pcrm.dorm.utexas.edu/ti/ .
> Another thing I NEVER do is write sub programs. That right there is bad
> TI basic. If you have to write a sub program just to make your main
> program work you need to seriously rethink your coding method. I write
> the code out ALL on paper first and then translate into TI Basic. Anyway
> since we have different calculators and different style I can see where
> this is going... nowhere & fast. Anyway you can play my programs. So
> feel free to give them a try and Enjoy!
> 
> Happy Programming,
> Christopher Robin MacDougald

I'm curious as to WHY you don't use sub programs? I've just recently 
started to, and I think it seems to work quite well, especially if you 
use something quite often. Actually for two reasons; 1) it can save 
space if the routine is repeated quite often, and 2) it can speed the 
program up, again it seems to have more effect if the sub program is 
used often. How do you work around an area in your code that has to be 
used by more than one place? For example;
If A=10
Goto 1
......
If X=50
Goto 1
......
Lbl 1
.....
(at this point how do you get back to where you came from? I think you 
have to add more labels after each "Goto 1", just to get back.)

If you used a sub program for label 1 it would save some space. 

I agree that Repeat seems to be the fastest. I think it is just a 
little bit faster than While. I'm not sure though, is Repeat faster 
than For(? 

When you use repeat to quickly get out of a Repeat loop, how do you 
account for the "End"? Or do you use Goto to jump to just in front of 
the End, but still within the loop?

Don't take any of this the wrong way. I'm not trying to beat a dead 
horse, I'm just trying to come up with the best (if there is a best) 
way to program these calculators. It's always fun to come across 
something that I didn't know before, something that will help optimize 
my stuff.

Jody Snider
jody1@alaska.net


Follow-Ups: References: