Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => Topic started by: BCTurk on January 07, 2006, 07:08:00 pm

Title: Base-X
Post by: BCTurk on January 07, 2006, 07:08:00 pm
I'm starting to make a program that would let you do arithmetic in a different base then base 10.  (For example, you could do calculation in any base from 2 (Binary) to 16 (Hexadecimal).  Is anyone interested in this kind of thing?  I'm only wondering because I just want to know if I should make it user-friendly or not, as it is really a training for a larger project that I'm not going to disclose atm.  Don't worry, I'm still working on my other projects, but PIRATES! is stalled/slowly moving until xLIB 0.6 is released.  The BASIC RPG is more of a in math-class thing to code, and this won't take too long.

So, anyone interested?

EDIT: Name of prog is now Base-X, because you can change base...
Title: Base-X
Post by: CDI on January 08, 2006, 03:33:00 am
If you make it, only make is 2,4,6,8,10,12,16,18, and 20 that way it'll have a nice range, but odd bases are harder to work with
Title: Base-X
Post by: BCTurk on January 08, 2006, 04:38:00 am
Oh, I dunno, my method works for all bases 2-10.  I'm working on one that does 11-16 (17-20 seems unuseble for any application).
Title: Base-X
Post by: Liazon on January 08, 2006, 06:36:00 am
include a binary to hex quick look up table.  4 binary digits equals one hex letter, and such a look up table would be useful.
Title: Base-X
Post by: MathStuf on January 08, 2006, 07:40:00 am
Well, converting between bases usually is more taxing than just going with base 10 to begin wtih (for calcs at least). I do have some base manipulation programs (2-36, operations with diff bases, times table maker for bases 2-36 (takes forever after ~base 12 though)).
Title: Base-X
Post by: BCTurk on January 09, 2006, 02:00:00 am
@calcul - Mmmm, I'll try, we will see, this will be put on hold if we/I do infact make a xLIB shell (which I might not).  The main idea for the program is to be able to do basic arithmetic in different bases.
Title: Base-X
Post by: BCTurk on January 11, 2006, 11:32:00 am
(Double-posting, uh-oh, I could get shot...O_Oshocked2.gif)

Ok, so I need some help.  Does anyone know of a good way to store whatever was just typed as a string.  The method I have right now works, but there's got to be a faster way.

c1-->
CODE
ec1
If Z=92
Then
Text(V,W,1
"1"->Str1
End
c2
ec2
Title: Base-X
Post by: Radical Pi on January 11, 2006, 11:36:00 am
c1-->
CODE
ec1Prompt Str1c2
ec2
Title: Base-X
Post by: BCTurk on January 11, 2006, 11:38:00 am
Problem is that it's graphscreen, and the user needs to push the button and see it onscreen, just like if they were just using the calc for math.
Title: Base-X
Post by: Liazon on January 11, 2006, 11:41:00 am
Design your own keyboard?
Title: Base-X
Post by: tifreak on January 11, 2006, 12:03:00 pm
I will send you the program tonight or tommorrow BC. :)smile.gif
Title: Base-X
Post by: dragon__lance on January 11, 2006, 12:26:00 pm
one way is to store a string of all letters. Then correspond each letter to a key press. This could get tricky though...
Title: Base-X
Post by: BCTurk on January 11, 2006, 01:39:00 pm
@calcul - do you mean that sarcastically?

@tifreak8x - Thanks many

@dragon_lance - Mmm, it would probably be slower as well :(sad.gif.
Title: Base-X
Post by: spengo on January 11, 2006, 01:42:00 pm
Sounds interesting. Something fun to play with to say the least. This will be for the z80 calcs right?
Title: Base-X
Post by: BCTurk on January 11, 2006, 01:43:00 pm
Si.  TI-83+ Family BASIC.
Title: Base-X
Post by: tifreak on January 11, 2006, 02:10:00 pm
check it out: http://www.tifreakware.calcgames.org/downloads/ZT3.8xp

You will want to modify it a bit, but I am sure you can understand the program... :)smile.gif If you have qs, please feel free to ask.

Oh yes, Spaces and any character less than 4 pixels wise mess up the backspace function, I really haven't found a way around this...
Title: Base-X
Post by: BCTurk on January 11, 2006, 02:17:00 pm
Mmm, very nice.  I will see about implementing this.  One question tho

c1-->
CODE
ec1
If K=23 and 1-length(Str2
c2
ec2

Isn't K the getKey?  How can it be two values?
Title: Base-X
Post by: tifreak on January 11, 2006, 02:24:00 pm
be two values?  It isn't... The most is it checks to see what buttons are pressed...

And yes, K is the getkey...
Title: Base-X
Post by: BCTurk on January 11, 2006, 02:26:00 pm
oops, I pretended there was a K in front of the 1-lenght part, my bad.
Title: Base-X
Post by: tifreak on January 11, 2006, 02:30:00 pm
lol, no prob. Hope you can make the prog work to what you need. :)smile.gif
Title: Base-X
Post by: BCTurk on January 11, 2006, 02:34:00 pm
Yeah, easily enought.  Have to brush up on my sub( syntax tho.  Oh, and about the backspace problem, every time one of them is disp'ed, you could set a varible so that when you hit backspace, it backspaced that many pixles.
Title: Base-X
Post by: tifreak on January 11, 2006, 02:43:00 pm
Problem with that theory is, you will have to have it search the key pressed and compare to string character, to determine that, which would bloat the code... Currently, it just adds 4 to a variable, and when backspaced, it subtracts 4 from the variable...
Title: Base-X
Post by: BCTurk on January 11, 2006, 03:02:00 pm
Change 4 to a varible (say P), and use a if statement for all of the characters that are < 4 pixles.  I'll upload it in a minute...

EDIT: Uploader is down, but you get the idea.