Long time since I've touched TI-BASIC again (yes, Axe is that addicting ;D). I made a quick program that's becoming really useful for ASM: a program that calculates anything in binary, octal, decimal, hex, or any combination of the four. In other words, type in something like "b10110101+o571-x1E+241" and it'll output the answer as 769. Since it calculates using the expr( command, you can put literally any numerical expression in and it'll solve correctly, including exponents, trig, and other functions. Shot below Smile



Download
That sounds awesome! You should be sure to submit it to the Cemetech archives as well. Smile You say you can put any numerical expression in - how does that work exactly? Does your program find the next B or O or H and then pass off that chunk to expr()? This means that you can use variables B, H, and O inside an expression, correct?
Nope, unfortunately, B, O, and H don't work as variables anymore. An earlier version used b, o, and x (lowercase) for bin, oct, and hex, but people said that they would rather just use uppercase, so I changed it. Basically, the program just inserts the decimal value of a number where another base used to be. The entire string is sent to expr(, so anything expression should work except those that use B, O, or H as a var.
Very nice. I still need to get my feet wet in Axe in my free time. Maybe after I don't have an unlimited amount of projects on my plate XD

Also, why not just stick with lowercase if there's a possible conflict with uppercase? That seems like a silly thing to change just because of particular preference.
Deep Thought wrote:
Nope, unfortunately, B, O, and H don't work as variables anymore.
Sorry, typo on my part, that was supposed to say *can't instead of can.
Quote:
An earlier version used b, o, and x (lowercase) for bin, oct, and hex, but people said that they would rather just use uppercase, so I changed it. Basically, the program just inserts the decimal value of a number where another base used to be. The entire string is sent to expr(, so anything expression should work except those that use B, O, or H as a var.
Gotcha, that's what I expected. I don't agree with everyone else about the lowercase though. Sad Sidebar, I was unfortunately forced to reject your submission because it was a plain .8xp; please drop it into a zip, add a readme, and resubmit! Smile
Well, changed it back, did some optimizing, and added a new feature: Decimal points.

Not sure when they'd be useful, but now you can do stuff like x24E.3FC2 Very Happy
Deep Thought wrote:
Well, changed it back, did some optimizing, and added a new feature: Decimal points.

Not sure when they'd be useful, but now you can do stuff like x24E.3FC2 Very Happy
That's great, I'm glad to hear it. Are you planning on adding any alternative to 2nd-Quit in order to get out of the program?
Right, I'll probably make it just an x or something (for exit).

And I'm thinking of adding final conversion to hex (with ▶Rect), octal (with ▶Frac), and binary (with ▶Polar).
Nice idea. I may use this if I ever learn ASM or get into more complicated ideas with Axe.
Deep Thought wrote:
Right, I'll probably make it just an x or something (for exit).

And I'm thinking of adding final conversion to hex (with ▶Rect), octal (with ▶Frac), and binary (with ▶Polar).
I approve, that sounds like a good plan, although you should then make h or help show some usage instructions. One thing I used to do with homescreen+Input types of programs was to make a special value such as 99.99 the escape condition.
I think too much hard-coded stuff would slow it down, though. Is the decimal stuff really necessary? I could take it out for about 25% more speed.
Deep Thought wrote:
I think too much hard-coded stuff would slow it down, though. Is the decimal stuff really necessary? I could take it out for about 25% more speed.
It depends what you're targeting. 95% of z80 ASM coders aren't going to worry about floating point math at all, and if they do, they're going to leave it to the TI-OS routines. On the other hand, if you're trying to make a program for math students as well, then it would be better to leave it in.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement