Author Topic: 1337 BASIC  (Read 3149 times)

0 Members and 1 Guest are viewing this topic.

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
1337 BASIC
« 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 )
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

crzyrbl

  • Guest
1337 BASIC
« Reply #1 on: December 03, 2005, 07:03:00 pm »
L1(1)+(99L1(1

save 2 bits  ;)wink.gif

Offline Spellshaper

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1690
  • Rating: +0/-0
  • This is me. Or maybe not.
    • View Profile
1337 BASIC
« Reply #2 on: December 04, 2005, 01:23:00 am »
Yeah, it

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
1337 BASIC
« Reply #3 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...
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55872
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
1337 BASIC
« Reply #4 on: December 04, 2005, 02:56:00 pm »
nice you are porting your old games to 82?

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
1337 BASIC
« Reply #5 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
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

CDI

  • Guest
1337 BASIC
« Reply #6 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!

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55872
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
1337 BASIC
« Reply #7 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

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
1337 BASIC
« Reply #8 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
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

katmaster

  • Guest
1337 BASIC
« Reply #9 on: December 11, 2005, 06:32:00 pm »
The main problem with 82s and 83s is their lack of archive.  

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
1337 BASIC
« Reply #10 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...
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

crzyrbl

  • Guest
1337 BASIC
« Reply #11 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.

dragon__lance

  • Guest
1337 BASIC
« Reply #12 on: December 30, 2005, 12:52:00 pm »
y don't u test it?  

MathStuf

  • Guest
1337 BASIC
« Reply #13 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.