ClrHome Disp "yeongJIN-COOL'S","Universal","Base Converter"," Pause "Press Enter ClrHome Input "TYPE NUM ",Str1 Input "BASE OF NUM ",A Input "BASE TO CONVERT ",Y "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str0 DelVar Xlength(Str1→B For(D,1,A If Str2=sub(Str0,D,1 D→E End X+(E-1)A^(C-1→X End "_→Str2 If not(X "0→Str2 While X sub(Str0,X-YiPart(X/Y)+1,1)+Str2→Str2 iPart(X/Y→X If Ans<Y Then sub(Str0,Ans+1,1)+Str2→Str2 DelVar X End End DelVar ADelVar BDelVar CDelVar DDelVar EDelVar XDelVar YDelVar Str0DelVar Str1Disp "RESULT",Str2
There are other optimizations that I missed I'm sure since I'm out of practice sort of. You can obviously shave off more if you take out the lowercase letters. It's a nice program though.
For the sake of the topic it is just to display it and/or store it so no need to make recalling it Axe friendly So I believe this will be the end of optimizations on that one (Unless further optimizations are made to make it smaller that displays the same thing, of course.) That is a very tricky optimization though, how did you figure out the string order?
In 83/84 basic, I got it down to 99 bytes with a one letter program name. Wabbit crashed upon export, so I have no proof of it, but I doubt if it can get any smaller.
Edit: If I just have to display it, I can make it smaller (if anyone cares).
Check the new topic I made in the TI-BASIC sub-forum
Is there a reason that sometimes the box is sometimes one pixel away from him and other times it is right next to him? Just thought I'd point that out in case it becomes an issue for some reason.
So SirCmpwn's new topic about his 60 byte converter got me thinking about trying to beat it in Pure TI-BASIC...however I don't think it's possible. So, I just decided to try to make the smallest one I could possible and thought I'd share what I came up with. However, that's not the point of this thread. This thread is for people to post their own Pure TI-BASIC routines to convert a image on the graph screen into hex data. Just thought it'd be interesting to see what other people come up with.
"_ For(A,0,15 Ans+sub("0123456789ABCDEF",sum(seq(2^(3-B)pxl-Test(iPart(A/2),B+8fPart(A/2)),B,0,3))+1,1 End sub(Ans,2,16 Phenomist's:
Code: (Optimized from my slower one; 88 bytes) [Select]
"_ For(A,0,7 For(B,0,1 Ans+sub("084C2A6E195D3B7F",sum(seq(2^Cpxl-Test(A,4B+C),C,0,3))+1,1 End End sub(Ans,2,16
See what you can come up with and I'll add them to the list
Mine so far is the smallest at 84 bytes, 83 byte if done on graph screen, but it only displays it. For storing it Phenomist now holds the record at 88 bytes. Can anyone beat them?
P.S. Sorry for using [code][/code] tags inside the [spoiler][/spoiler] tags but just want to see what people come up with without being influenced by other people's code.
You actually can just replace the If dim(rand(15)) with rand(15) because by the time it reaches fourth line in the main program Ans gets overwritten anyways. Unless one of your other program uses Ans as a starting variable? Just thought I'd tell you.
Is there anything your particularly looking for? A certain part that you want to see if can be made faster, parts to be made smaller, improvements that you've thought of but not sure about?
Isn't there a statement that just adds 0.1 to the number? Isn't that how I assign the number a spike? Would it fix it if there was a (fPart(L1(A))≠.1) type of thing there?