Author Topic: Calcalca  (Read 24052 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #15 on: May 29, 2010, 02:01:14 am »
Aaaah ok. I guess maybe it would be better to include them on their own, then.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #16 on: May 29, 2010, 02:23:02 am »
By the way, does anyone know of a PEMDAS-style evaluator in BASIC? It'd be really helpful for me when I add the operators.




Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: Calcalca
« Reply #17 on: May 29, 2010, 12:46:08 pm »
Isn't there also m3 for volume? (cube meter)

That's what we often used in physics classes over here besides liters

I'm also treating operations (all operations, not just exponents) separately.

Actually, that's the part that stumped me when I first made this program a year ago. I could get multiplication and implied multiplication working fine, but not division, exponents, or parentheses. Do you think I should just simplify things by including squares and cubes as units on their own?

What I did with exponents is that for 2 and 3 or any kind of roots, I would change them to "^2" or "^3" or "^(1/2)" etc.
If I had your program and my calculator, I would be able to help you more... I don't know exactly how your program works


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Calcalca
« Reply #18 on: May 29, 2010, 01:25:10 pm »
I made a program that does all of these conversions in the same way and a whole lot more other features that I used for chemistry.  I can show you the source code if you'd like, I never released it.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Calcalca
« Reply #19 on: May 29, 2010, 02:15:12 pm »
I made a program that does all of these conversions in the same way and a whole lot more other features that I used for chemistry.  I can show you the source code if you'd like, I never released it.

So you already made a program like this?

By the way, does anyone know of a PEMDAS-style evaluator in BASIC? It'd be really helpful for me when I add the operators.

Doesn't the calculator already do this by default?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #20 on: May 31, 2010, 11:26:03 am »
I made a program that does all of these conversions in the same way and a whole lot more other features that I used for chemistry.  I can show you the source code if you'd like, I never released it.

Sure. How much memory does it take up, just for reference?

By the way, does anyone know of a PEMDAS-style evaluator in BASIC? It'd be really helpful for me when I add the operators.

Doesn't the calculator already do this by default?

Yeah, but I wanted to see a BASIC program for the source code.

Good point, though. Probably no one would bother to make another one.

EDIT:
(I know I'm quoting myself here, but I'm too lazy to type it all out.)
Unfortunately, I couldn't figure out division, parentheses, or exponents, so I set it aside and continued with other projects. One day, I really needed to clear some ARC space, so I deleted the group where I had saved it (I called it CALCALCA). I finally started regretting this decision, and will start coding it again, but I really need help with the issues I mentioned above.

Never mind! The operations turned out easier than I thought, or at least easier than it seemed last year.

Thanks for offering your help, though!

UPDATE: Division, exponents, and 2/-1 all work! If all goes well, I can get the final version of this program at least onto my thumb drive by the end of the school year. :)

EDIT2: Wow, this is the first time xor has ever been useful to me.

UPDATE2: Now it supports all of the units listed above, with all SI prefixes from yocto to Yotta. Anyone think I'm overdoing this?

This is DEEP THOUGHT'S 42nd post!
« Last Edit: May 31, 2010, 12:44:10 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #21 on: May 31, 2010, 12:59:52 pm »
Nice to see more progress :)


Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Calcalca
« Reply #22 on: May 31, 2010, 01:07:44 pm »
Wow, this is the first time xor has ever been useful to me.
Nice! ;D
I'm glad you're over here, Deep Thought!  I'd like to mention that I thought Insanity was great.  Nice job on it. :D

This looks pretty cool.  Good luck on it! :)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #23 on: June 01, 2010, 07:21:01 pm »
Thanks for all the support!

UPDATE: And it's done!

*beta program would have been here if TI-Connect had been working*

TI-Connect isn't working ... again. I've uninstalled and reinstalled it twice in the past hour already, and it still doesn't work. When I plug in a TI-84 Plus via a direct USB cable, it starts installing driver software, but TI-Connect doesn't recognize it. I also tried TiLP (twice also), but as soon as I open it up after installing the program, it displays a message that says it's missing some kind of "entry point" in the .dll file. Anyone have any idea what's going on here? I'm using Windows Vista, by the way.

I would have transferred the programs on the school iMac (and downloaded Axe), but for some reason my thumb drive didn't get recognized. All in all, I'm just having a horrible day with all the computers I've been using failing on me.




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #24 on: June 01, 2010, 08:22:13 pm »
You might want to ask this question in a separate thread as it might get missed by some users who come to help.

Glad to see progress, though

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Calcalca
« Reply #25 on: June 01, 2010, 10:56:08 pm »
What exactly was happening? (With TI-Connect.)
From what it sounds you were plugging the USB and the calculator into that and it won't just get recognized, right?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #26 on: June 02, 2010, 12:04:53 am »
What exactly was happening? (With TI-Connect.)
From what it sounds you were plugging the USB and the calculator into that and it won't just get recognized, right?

Yeah, that's about it. It was recognized by the driver installer, but not by TI-Connect.

Might just be the calculator. I was using a friend's TI-84 Plus which had been buggy (in calc-to-comp connections) in the past, while I've also used a TI-84 Plus Silver Edition that worked perfectly.

You might want to ask this question in a separate thread as it might get missed by some users who come to help.

Glad to see progress, though

I'll do that if I later if I still can't get it to work.

And I know it's been a while since this post was made, but:
Quote
Well, that's unfortunate. I can only upload files until mid-June.
Do you mean you do not have internet access at home, only at school? I remember when I was in that situation. Very hectic x.x (altough I generally got a lot of free time for programming :P).

Well, not exactly; there are other reasons. But here's a perfect example why I'd prefer to transfer programs at school even if I could do it at home.




Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Calcalca
« Reply #27 on: June 02, 2010, 12:19:23 am »
Well it could also be the USB slot to. I know I have trouble with a couple of mine on my computer so you could just try switching where the cable is plugged in to see if that works.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #28 on: June 02, 2010, 06:54:01 pm »
Well it could also be the USB slot to. I know I have trouble with a couple of mine on my computer so you could just try switching where the cable is plugged in to see if that works.

Tried that, still didn't work. :(

Anyway, TI-Connect at school works (I love Macs :D), so here's a version of my program. It comes as a group with two programs: CALCALCA (the main program) and LOW (an ASM subroutine to allow lowercase).

When you run prgmCALCALCA, nothing seems to happen, and the calculator still seems to be at the homescreen. It's actually already in the program; the blank screen is from the Input "",Str1. The program leaves most of the calculation intact, so if you type in a normal expression (such as 1+1), it'll just display the answer (with expr(Str1. The key is that the program checks for the string "_into_ or " INTO (notice the spaces), and if it's found within the input, it goes into evaluation mode.

Syntax for evaluation is [expression] into [unit] or [expression] INTO [unit] (again, notice the spaces). Other spaces are ignored by the evaluator, so you could type 5 N m into ft lb or 5Nm into ft*lb, and it would display the same answer. This is so that input is more natural and easier to read. However, the program is actually looping through each character in the string input, so the shorter the input, the faster the program can evaluate it.

If the units are mismatched on the two sides of the input, the programs throws an ERR:MISMATCH, but I have yet to add the other error messages (e.g., for unrecognized units).

I haven't compiled a list of supported units left, but in case you're wondering, they're all in Str1 (after you run the program at least once). Just look for the alpha characters. By the way, the program is case sensitive, so mPa is millipascals, while MPa is megapascals. Do not put an extra s at the end of a unit, even for a unit such as lb.

All SI prefixes from yocto to Yotta are supported, except for milli- and Tera- on three-character base units (such as cal, acr, and are), as well as millitonnes (who would ever use that?). All units must be abbreviated. Thus, 5 amperes2*6 ohms INTO milliwatts will not work, while 5 A2*6 ohm INTO mW will.

Addition, subtraction, and functions are not supported, and probably never will be, but since they are simply skipped over by the evaluator, 8 J into ft-lb will be read as "8 (J)" into "(ft)(lb)". Unlimited numbers of parentheses, division, exponentiation (including 2, 3, and -1), and multiplication (duh) are supported.

I know, the program still runs pretty slowly. I'll still have to optimize some things. Until then, everyone is allowed (and encouraged) to look into the code, and suggestions are (very) welcome.

EDIT: Next time I post an update, I'll probably also include an easter egg ... or two. :)

EDIT2: Conditions remarked on in previous statement achieved here.
« Last Edit: June 03, 2010, 06:12:20 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #29 on: June 03, 2010, 01:26:43 am »
Nice to see this out. Sadly I doubt I'll have time to test anything for a long while, though, because I have a lot of stuff to do soon :(