Okay so I was at school today and had a fat 2 hour break in between two classes, so I sat down with a calc and started looking at some optimizations that could be brought to some programs. In one of my programs, I noticed the numpad reader routine straight from tibasicdev, which is basically a function that loops around (sorta)
Here is the line from that routine on tibasicdev.
Code:
And here is the one I came up with, which works and is smaller, and I would assume faster, since the string is smaller...
Code:
And some screenies to show what I did to end up with this...
Basically, I just modified the fuction so that it would loop around without the need for the two extra spaces in between each set of characters in the string...
Just thought I'd share this with the people in case you would want to use that routine I guess... Oh and I'd like to know if anyone sees any flaw in my routine... You know, in case the other routine was better after all...
Here is the line from that routine on tibasicdev.
Code:
sub("789 456 123 0.",K-36-5int(.1K),1
And here is the one I came up with, which works and is smaller, and I would assume faster, since the string is smaller...
Code:
sub("7894561230.",K-22-7int(.1K),1
And some screenies to show what I did to end up with this...
Basically, I just modified the fuction so that it would loop around without the need for the two extra spaces in between each set of characters in the string...
Just thought I'd share this with the people in case you would want to use that routine I guess... Oh and I'd like to know if anyone sees any flaw in my routine... You know, in case the other routine was better after all...