Author Topic: Hybrid TI-Basic DIY Library Creator  (Read 1806 times)

0 Members and 1 Guest are viewing this topic.

Offline 123outerme

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 458
  • Rating: +23/-0
  • Self-unpaid intern
    • View Profile
Hybrid TI-Basic DIY Library Creator
« on: January 16, 2017, 09:53:32 am »
I'm going to rework the code I had for the "TI-Basic Library" into a DIY-Library maker! Got some code that repeats over-and-over, and you want to save space? Easy! You can create your own customly-named AppVar, holding all the information, from the name of the function, to the subroutines they execute! The interpreter only takes up 170 bytes of RAM, so provided you can save that much with whatever algorithms you use with DIYLIB, it could potentially be helpful to you!
Unfortunately, there are some drawbacks so far:
*Can only handle one input after the (. You can technically have more than one input, you just have to make sure it isn't destroyed by any variable used by prgmDIYLIB
*Can only handle number inputs
*Only technically works on the CSE. It would be pretty easy to port to monochrome calcs (and possibly the CE), so if you're interested, contact me!
*Running it is most likely slower than just typing out the equation normally

(note: This is not a serious project. I finished this in like 4 hours and felt like it was cool to mess around with)


Running this set of code to determine speed. Here you can see how many times the loop repeats and the command/equates I used.
Code: [Select]
"rowSwap(LIBNEW00→Str0
startTmr→T
For(F,1,150
"DIGIT(F
prgmDIYLIB
End
checkTmr(T-I
Ans/150→G
startTmr→T
For(F,1,150
int(1+log(real(F+(0=real(F
End
checkTmr(T)→J
Ans150→H
Disp G,H," ",I,J
Pause
Now here's the results.
[loops] = 150: DIYLIB took an average of .16 seconds to process each request, and the straight command took .013333.... seconds.
DIYLIB, in 150 loops, took ~24 seconds, while the straight command only took ~2.
« Last Edit: January 16, 2017, 05:54:47 pm by 123outerme »