Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: DJ Omnimaga on July 07, 2006, 01:28:00 pm

Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 07, 2006, 01:28:00 pm
hmm okay dysfunction was always wondering why map loading took so long in Diortem and Metroid II (between 1 and 4 seconds), well before you continue reading, I must warn you: the code below may be offensive to BASIC programmers, because there is so many things that are done at map loading that after a while the code went so messy that it now reminds me my old days of Illusiat (without the Lbl/gotos)  O_Oshocked2.gif:knight:knight3.gif and I got headache reading it. Btw this is one of the reason why Diortem died the first time, I gave up on this code. Now i rewriten most of it before finishing metriod but still... I was wondering if there would be some stuff that could be made more optimized in this mess >.
c1-->
CODE
ec10→PMT
If A≤1:Then:7→A:
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: kalan_vod on July 07, 2006, 06:40:00 pm
o.oblink.gif


Yeah I see a few things to work on, it will improve speed and size some what. I assume the
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: Spellshaper on July 07, 2006, 11:34:00 pm
QuoteBegin-xlibman+Jul 8 2006, 02:28 AM-->
QUOTE (xlibman @ Jul 8 2006, 02:28 AM)
c1-->
CODE
ec1
...

If [A](1,1)≠36 and
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 08, 2006, 06:34:00 am
hmm interesting, I should try this to see if it works, lot smaller
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: kalan_vod on July 08, 2006, 06:38:00 am
What exactly can
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 08, 2006, 06:49:00 am
the big N in the finance app, its the map ID
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: kalan_vod on July 08, 2006, 07:15:00 am
I figured that, as graphlink changed it to it :Ptongue.gif.
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: Demon on July 08, 2006, 08:46:00 am
QUOTE
the code below may be offensive to BASIC programmers....I got headache reading it.


It's not offensive but it confused the heck out of me - I just looked at the first few lines and my brain went:
QuoteBegin
-->
QUOTE
ERR:OVERFLOW
1: QUIT
2: GOTO

But I never knew you could use those FINANCE vars as... er, well, vars...
:knight:knight3.gif

*pyro_xp2k
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: Speler on July 08, 2006, 09:07:00 am
QUOTE
But I never knew you could use those FINANCE vars as... er, well, vars...

Well, you can and not only that but Finance Vars are not only faster then normal Vars but faster then Ans as well, which is the reason I use them in anything that needs to have an ubsurly high screen refresh rate.
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 08, 2006, 09:31:00 am
o.oblink.gif that I didnt knew O_Oshocked2.gif

ok I guess I'll try to use those instead of A and B for character moving then if i make a new game :Ptongue.gif
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: kalan_vod on July 08, 2006, 09:33:00 pm
Well they can't be deleted like with A-theta and they take up one extra byte I believe.
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 09, 2006, 01:26:00 am
you mean, token wise? (as some tokens takes 2 bytes instead of 1)
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: kalan_vod on July 09, 2006, 07:57:00 am
QuoteBegin-xlibman+Jul 9 2006, 07:26 AM-->
QUOTE (xlibman @ Jul 9 2006, 07:26 AM)
you mean, token wise? (as some tokens takes 2 bytes instead of 1)  

 Finance vars.
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 09, 2006, 10:09:00 am
yeah I know you are talking about those, but when pasting for example "PMT" in a program does it takes 2 bytes instead of 1? Like lowercase letters? Also technically we cant even delete a finance var, as it will be set back to 0 so it will always take space
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: Speler on July 09, 2006, 10:41:00 am
QUOTE
yeah I know you are talking about those, but when pasting for example "PMT" in a program does it takes 2 bytes instead of 1? Like lowercase letters? Also technically we cant even delete a finance var, as it will be set back to 0 so it will always take space

Lets go over the advantages and disadvantages.

Advantages:
-Fastest

Disadvantages:
-Can't use with DeleteVar or for(
-2 bytes rather then one.

So I will say this:  it is not always the best choice of variable, but is a nice thing to know that it can be used if needed.
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 09, 2006, 10:48:00 am
or when running out of real vars
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: kalan_vod on July 09, 2006, 11:31:00 am
Ok, I finished optimizing it. Is this just a program in M2E? I need to test something, as I think I can save a few more bytes. As of now I got it down about 4xxbytes.
Title: [83+ BASIC]Here's why Kalan's better coder than me
Post by: DJ Omnimaga on July 09, 2006, 12:08:00 pm
it is a program in metroid II e