Author Topic: Calcalca  (Read 27565 times)

0 Members and 3 Guests are viewing this topic.

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 #75 on: June 09, 2010, 07:50:17 pm »
Oh, it works for all the loops...

That'll be helpful. Thanks.




SirCmpwn

  • Guest
Re: Calcalca
« Reply #76 on: June 09, 2010, 07:51:34 pm »
Sure thing.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Calcalca
« Reply #77 on: June 09, 2010, 10:55:37 pm »
If you did do something that would make it faster but you'd have repeditive code you could always make either a sub-program that is recalled or put a Lbl at the top of the program with the code.

Oh, yeah, I heard about that trick with the For( loop and the end inside the label. Does it only work with For( loops, not While or Repeat ?

What trick are you talking about? I just meant if you have repetitive code put it at the top of the program in a Lbl since TI-BASIC scans from top to bottom when searching for Lbls.
Spoiler For Spoiler:



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

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 #78 on: June 09, 2010, 11:00:10 pm »
Like this:

:Goto 1
:Lbl 2
:<subroutine here>
:End
:Lbl 1
:<code here>
:If <want to run subroutine>
:Then
:For(A,-1,0)  //CLOSE THIS!
:If A
:Goto 2
:End
:End
:<code here>

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 #79 on: June 10, 2010, 09:54:00 am »
If you did do something that would make it faster but you'd have repeditive code you could always make either a sub-program that is recalled or put a Lbl at the top of the program with the code.

Oh, yeah, I heard about that trick with the For( loop and the end inside the label. Does it only work with For( loops, not While or Repeat ?

What trick are you talking about? I just meant if you have repetitive code put it at the top of the program in a Lbl since TI-BASIC scans from top to bottom when searching for Lbls.

That trick where, if a loop Gotos out to some Lbl, you can put the End in that label, even if it's before the loop that required it, and the loop won't cause any memory leaks.




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Calcalca
« Reply #80 on: June 10, 2010, 11:43:23 am »
Hey i made my own version of Calcalc, do you mind if i post 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 #81 on: June 10, 2010, 06:07:46 pm »
Hey i made my own version of Calcalc, do you mind if i post it?

Sure. Do you mind if I look through the coding?

EDIT: Wait, what language is it? BASIC, right?
« Last Edit: June 10, 2010, 06:08:32 pm by Deep Thought »




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Calcalca
« Reply #82 on: June 10, 2010, 06:33:51 pm »
Yeah its Basic, and pretty fast if i do say so myself.  Here are the programs, run Calc to run the program.  Syntax is very loose, but there are no lowercase, since i thought that it would be more hassle than its worth to type them in, plus when the program is compiled into a single program, it means that there will be only a single program (about 1000 bytes).  These next aexpressions are all legal:

5M TO CM
5M TO CM
5 M TO CM
5(M) TO CM

It currently supports these units, although adding more is trivial:
Code: [Select]
Meters  (m)
Centimeters (cm)
Milimeters (mm)
Kilometers (km)
Inches (in)
Feet (ft)
Yards (yd)
Miles (Ml)
Kilograms (KG)
Grams (G)
Pound mass (lbm)
Ounce (oz)
Newton (n)
Pascal (pa)
PSI (psi)
Joules (j)
Electron Volts (ev)
Seconds (s)
Minutes (min)
Hours (h)
Pound Force (lbf)
Watts (w)
KiloWatts (kw)
Volts (v)
KiloVolts (kv)
Ohms (ohm)
Amps (a)

The program is also written so that adding extra units does not impact speed very much at all.  It does have some load time at startup though.  I wanted to keep size at a minimum so it precalculates a lot of data.

EDIT: Also note that i dont do any unit checking so it lets you do silly things like convert feet to seconds :P
« Last Edit: June 10, 2010, 06:34:48 pm by Builderboy »

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 #83 on: June 10, 2010, 06:46:26 pm »
Wow, that is fast. And small.
« Last Edit: July 06, 2010, 12:12:39 am by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #84 on: June 10, 2010, 07:42:55 pm »
wow nice Builderboy!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Calcalca
« Reply #85 on: June 23, 2010, 02:46:48 am »
I hope i didnt kill this project D: Has there been any progress?

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 #86 on: June 25, 2010, 10:55:24 pm »
Don't worry, I'm never gonna give this up :) Calcalca is still on my calculator (in the form of a group), but I'm not going to be working on it for a while (I've put it in "indefinite hold" mode).

The biggest problem right now is the speed, as everyone will probably notice. I like the way your program converts the data to a list at startup, but for me to do that, I'd have to use at least five lists and two matrices, which would be both slow to initialize and hard to keep track of.

I probably won't be able to work more on Calcalca until September, since I'm in China right now (away from my calculator for a month and a half -- it's been absolutely horrible), and when I get back in mid-August, there's still a lot to do in terms of my Axe contest entry and a stupid AP Lang summer project.

EDIT: On second thought, I just came up with an idea that would let me start it up faster with only two lists. I'm still probably not going to be working on this for a bit, though.
« Last Edit: June 25, 2010, 11:37:32 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #87 on: June 25, 2010, 11:12:24 pm »
Ouch sorry to hear you cannot work on it anymore x.x

I'm glad it is not dead, though. I can't wait for your return. Are you still gonna be able to visit, btw? (well... through whatever mean you can use to bypass the "Great Firewall Of China")

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 #88 on: June 25, 2010, 11:28:50 pm »
Yes, they haven't blocked Omnimaga, thankfully, and I don't see any reason for them to. It's not like calculator programming threatens Communist totalitarianism :D

On the other hand, there's no doubt the Great Firewall exists. I can't access Google Images from any domain, and whenever I try to access a politically opinioned website, even if it's from a link on Google, the page magically doesn't exist.

Earlier in the Firewall's history, the Chinese Internet police actually displayed on some open websites a cute little cartoon mascot of two police officers with the "cute" slogan "Watching you, watching me." I'd give you a link now, but it's blocked too :)

EDIT: Probably shouldn't even post that. I wouldn't want to get Omni blocked here :P
« Last Edit: June 25, 2010, 11:30:50 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #89 on: June 25, 2010, 11:31:28 pm »
Oh ok because Nitacku was in china recently (I forgot where... just search for Nitacku in recent #omnimaga/OmnomIRC logs and you might find it) and he had to proxy his way through IRC and Omnimaga to access them.