Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: tifreak on December 03, 2005, 04:14:00 pm

Title: 1337 BASIC
Post by: tifreak on December 03, 2005, 04:14:00 pm
If you are looking for optimized BASIC code, this will be the place to look.



If you are looking for 'restriction code', you do this:

L1(1)+(L1(1)<99)->L1(1

This will keep a stat from exceeding '99' without needing an If statement.

(I found this out while porting AOD from the 83+ to the 82. Trust me, after figuring this out, I called my self many names...  :lmao:ptdr.gif )
Title: 1337 BASIC
Post by: crzyrbl on December 03, 2005, 07:03:00 pm
L1(1)+(99L1(1

save 2 bits  ;)wink.gif
Title: 1337 BASIC
Post by: Spellshaper on December 04, 2005, 01:23:00 am
Yeah, it
Title: 1337 BASIC
Post by: tifreak on December 04, 2005, 08:27:00 am
QuoteBegin-crzyrbl+4 December 2005, 1:03-->
QUOTE (crzyrbl @ 4 December 2005, 1:03)
L1(1)+(99L1(1

save 2 bits  ;)wink.gif

 Yeah, I guess that will work.  :)smile.gif

Maybe I will need to go back through AOD on the 83+ and do some optimizing... :)smile.gif After of course, AOD 82 makes its debut...
Title: 1337 BASIC
Post by: DJ Omnimaga on December 04, 2005, 02:56:00 pm
nice you are porting your old games to 82?
Title: 1337 BASIC
Post by: tifreak on December 05, 2005, 04:35:00 am
I am porting AOD (The graphical version) to the 82 and the 86, and then will go from there...I know AODOLD and AODR won't go to the 82, unless I learn asm for it... I might be able to port aod2 to it, but I don't really know what kind of dependance aod2 has for strings...

I am however, going to go through all my old games and begin updating them with the newer stuff that I know, for optimization... :Dbiggrin.gif
Title: 1337 BASIC
Post by: CDI on December 05, 2005, 12:33:00 pm
@tifreak8x and first post - it's technally called boolean logic

i.e.

c1-->
CODE
ec1ClrHome
1->C:1->D
Repeat X=45
Output(C,D,0
getKey->X
If X:Output(C,D,"
C+(X=34 and C!=8)-(X=25 and C!=1->C
D+(X=26 and D!=16)-(X=24 and D!=1->D
Endc2
ec2

ta da!

100b EXACTALLY!
Title: 1337 BASIC
Post by: DJ Omnimaga on December 05, 2005, 12:49:00 pm
sound nice, I might post diortem's one soon.


@tifreak8x: yeah 82 calcs doesnt have strings in BASIC :(sad.gif
Title: 1337 BASIC
Post by: tifreak on December 06, 2005, 03:22:00 pm
QuoteBegin-xlibman+5 December 2005, 18:49-->
QUOTE (xlibman @ 5 December 2005, 18:49)
sound nice, I might post diortem's one soon.


@tifreak8x: yeah 82 calcs doesnt have strings in BASIC :(sad.gif

 I know, but it makes it more fun to program for... :)smile.gif
Title: 1337 BASIC
Post by: katmaster on December 11, 2005, 06:32:00 pm
The main problem with 82s and 83s is their lack of archive.  
Title: 1337 BASIC
Post by: tifreak on December 12, 2005, 01:23:00 am
It isn't so much a problem, just a challenge to program good, long games for on a very limited platform... :)smile.gif

AOD82 is almost complete...
Title: 1337 BASIC
Post by: crzyrbl on December 30, 2005, 09:57:00 am
QuoteBegin-CDI+5 December 2005, 18:33-->
QUOTE (CDI @ 5 December 2005, 18:33)
c1-->
CODE
ec1ClrHome
1->C:1->D
Repeat X=45
Output(C,D,0
getKey->X
If X:Output(C,D,"
C+(X=34 and C!=8)-(X=25 and C!=1->C
D+(X=26 and D!=16)-(X=24 and D!=1->D
Endc2
ec2

which is faster, this:

c1
-->
CODE
ec1C+(X=34 and C!=8)-(X=25 and C!=1->C
D+(X=26 and D!=16)-(X=24 and D!=1->Dc2
ec2

or this:


c1
-->
CODE
ec1C+(X=34)(C!=8)-(X=25)(C!=1->C
D+(X=26)(D!=16)-(X=24)(D!=1->Dc2
ec2

the lower one adds 4b but doesnt have to go though the "and" method.
Title: 1337 BASIC
Post by: dragon__lance on December 30, 2005, 12:52:00 pm
y don't u test it?  
Title: 1337 BASIC
Post by: MathStuf on January 04, 2006, 01:14:00 pm
It depends on how BASIC handles conditionals. If it looks ahead and quits out of an AND if any are wrong, go with the first, otherwise, test it in a loop. If it does, put the one most likely to be wrong first.