Author Topic: Undocumented TI-BASIC tricks  (Read 81774 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
Undocumented TI-BASIC tricks
« Reply #75 on: December 29, 2005, 02:45:00 am »
Like I said in my earlier post, that can actually slow the game down, if you use a lot of them, since it has to do all the calculations every loop...
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

dysfunction

  • Guest
Undocumented TI-BASIC tricks
« Reply #76 on: December 29, 2005, 12:54:00 pm »
Yeah I tried to optimize my TBS engine with those, and it ended up running at almost exactly the same speed. Booleans are faster than If:Then only if you don't have extremely complicated movement routines.

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
Undocumented TI-BASIC tricks
« Reply #77 on: December 29, 2005, 01:03:00 pm »
Yes, I meant exactly that.
I don't think my games are slowed by it that much, I only use it for moving left/right/up/down.
One of these days I'll get a sig I'm really proud of.

tenniskid493

  • Guest
Undocumented TI-BASIC tricks
« Reply #78 on: December 29, 2005, 03:53:00 pm »
Ok, good.  I had to try to guess at what you meant.  I have a few of those in my game but, like tifreak8x said, if you use to many of them, they can do more harm than good.

dysfunction

  • Guest
Undocumented TI-BASIC tricks
« Reply #79 on: December 29, 2005, 07:50:00 pm »
I would love for an assembly coder to go in CalcSys or a debugger and see exactly how many clock cycles each of these commands takes and make a table, then we could just add up the cpu time required by each command in a routine to see which is faster.

dragon__lance

  • Guest
Undocumented TI-BASIC tricks
« Reply #80 on: December 30, 2005, 04:52:00 am »
y don't we ask that over at MC forums, maybe one of those asm gurus will do it? :)smile.gif

dysfunction

  • Guest
Undocumented TI-BASIC tricks
« Reply #81 on: December 30, 2005, 07:21:00 am »
Good idea, I think I will!

dragon__lance

  • Guest
Undocumented TI-BASIC tricks
« Reply #82 on: January 04, 2006, 02:31:00 pm »
ok, today in math class, had a lot of time so did some testing on speed of stuff.here's wat i got
-(everyone except me probably knew this, but ANS work faster than the number)
-Using the real number instead of variable works faster, real(0 will work faster than real(A

tenniskid493

  • Guest
Undocumented TI-BASIC tricks
« Reply #83 on: January 04, 2006, 02:35:00 pm »
Sweet.  I never knew about the Ans thing.  For the number faster than variable, it makes sense.  Instead of having to search the VAT for the variable to get the value, it has the value provided for it immediately.  Still good to know though.

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Undocumented TI-BASIC tricks
« Reply #84 on: January 04, 2006, 02:45:00 pm »
Using ans is alright, but if you are doing any other equations, ans will be messed up. :)smile.gif

Basically, ans is good for simple things (I use it for a program that has multiple routines, I just store the number to ans, call the program, then the first line in the program is Ans->L :)smile.gif

That makes things a little smaller and faster...
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline necro

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1295
  • Rating: +17/-2
  • +3 vaporal mustache
    • View Profile
Undocumented TI-BASIC tricks
« Reply #85 on: January 04, 2006, 03:36:00 pm »
trick to test if xlib is installed

1
real(0
not(Ans
If Ans:Pause "Install Xlib!
If Ans:Return
I'm like a woot burger with awesome fries


VB.Net, C#, C++, Java, Game Maker

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #86 on: January 04, 2006, 03:45:00 pm »
QuoteBegin-necro+4 January 2006, 21:36-->
QUOTE (necro @ 4 January 2006, 21:36)
trick to test if xlib is installed

1
real(0
not(Ans
If Ans:Pause "Install Xlib!
If Ans:Return  

 If you want to save a byte do

c1
-->
CODE
ec11
real(0
If not(Ans:Pause "Install Xlib!
If not(Ans:Returnc2
ec2
Doesn't save much but hey 1 byte is a byte!

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Undocumented TI-BASIC tricks
« Reply #87 on: January 04, 2006, 04:02:00 pm »
Check the code, it produces different results. Necro's produces 1, where yours produces 0.
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #88 on: January 04, 2006, 04:05:00 pm »
QuoteBegin-tifreak8x+4 January 2006, 22:02-->
QUOTE (tifreak8x @ 4 January 2006, 22:02)
Check the code, it produces different results. Necro's produces 1, where yours produces 0.  

 Yes but it has the same effect....

Offline necro

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1295
  • Rating: +17/-2
  • +3 vaporal mustache
    • View Profile
Undocumented TI-BASIC tricks
« Reply #89 on: January 04, 2006, 04:21:00 pm »
yes, you unrapped a line break and as such, "not(...:not(..." is better than an "not(Ans:"...if I had a third line of conditionals in there, it would be better my way though
I'm like a woot burger with awesome fries


VB.Net, C#, C++, Java, Game Maker