Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Munchor on October 17, 2010, 08:01:02 am

Title: Optimization Tips
Post by: Munchor on October 17, 2010, 08:01:02 am
Hello,

I'm doing a few little and simple programs to learn TI Basic, and I've been told that optimization is the key to TI_Basic.

So, here is a simple program I made:

Code: [Select]
Define LibPub helloname()=
Prgm
:RequestStr "Your name:",name
:RequestStr "Your location: ",location
:RequestStr "Your calculator: ",calculator
:Text "Name:"&name&""
:Text "Location: "&location&""
:Text "Calculator: "&calculator&""
:EndPrgm

Now, how can I optimize it?

I want simple tips like this:

Code: [Select]
Output(1,1,"Hello World")

Output(1,1,"Hello World

Thanks in advance!
Title: Re: Optimization Tips
Post by: meishe91 on October 17, 2010, 05:03:55 pm
I'm guessing this is for Nspire BASIC?
Title: Re: Optimization Tips
Post by: Happybobjr on October 17, 2010, 05:08:14 pm
ya, i think he has the nspire.
Title: Re: Optimization Tips
Post by: shrear on October 19, 2010, 04:40:23 pm
Well like this par example

Code: [Select]
Define LibPub helloname()=
Prgm
:RequestStr "Your name:",name
:RequestStr "Your location:",location
:RequestStr "Your calculator:",calculator
:Text "Name: "&name
:Text "Location: "&location
:Text "Calculator: "&calculator
:EndPrgm

Other things I don't see (which doesn't mean allot ;) )
Title: Re: Optimization Tips
Post by: Deep Toaster on October 19, 2010, 04:53:23 pm
Optimization's not really important on the Nspire, especially small stuff like that (it's more for the 83+/84+ series), because the Nspire's already so fast. Unless you're making something really complex, and then you'd need to look more at the bigger stuff (like moving things out of loops).
Title: Re: Optimization Tips
Post by: ASHBAD_ALVIN on October 19, 2010, 04:58:17 pm
Plus it has so much memory for programs too :P
Title: Re: Optimization Tips
Post by: Deep Toaster on October 19, 2010, 05:12:32 pm
Really? I thought it was the same as the normal TI-84 Plus...
Title: Re: Optimization Tips
Post by: calcdude84se on October 19, 2010, 05:48:08 pm
TI-84+SE, actually. Not too bad an amount. ;D
Title: Re: Optimization Tips
Post by: Munchor on October 19, 2010, 05:49:38 pm
Well like this par example

Code: [Select]
Define LibPub helloname()=
Prgm
:RequestStr "Your name:",name
:RequestStr "Your location:",location
:RequestStr "Your calculator:",calculator
:Text "Name: "&name
:Text "Location: "&location
:Text "Calculator: "&calculator
:EndPrgm

Other things I don't see (which doesn't mean allot ;) )

Thanks much!
Title: Re: Optimization Tips
Post by: Deep Toaster on October 19, 2010, 07:02:10 pm
Btw, is it illegal to distribute the 2.54MP OS (the one used by the Nspire, not the normal 84+ one)?
Title: Re: Optimization Tips
Post by: Munchor on October 19, 2010, 07:03:49 pm
Btw, is it illegal to distribute the 2.54MP OS (the one used by the Nspire, not the normal 84+ one)?

For texas pressing the button Program will be illegal some day

About that? No idea. Some OSs like 1.1 are illegal yeah
Title: Re: Optimization Tips
Post by: Deep Toaster on October 19, 2010, 07:12:22 pm
It's the most current one, though...

Does TI have it somewhere on their site?

Actually, is there even a way to update an Nspire 84 OS?
Title: Re: Optimization Tips
Post by: Munchor on October 19, 2010, 07:15:52 pm
Today, I connect my calculator (NSpire Touchpad with most recent OS) with a friend's calculator: TI NSpire, totally different OS.
I made "Sent OS" and she has Touchpad OS now, no idea it was possible.

If it is the latest one:

www.education.ti.com

If not: PM me.
Title: Re: Optimization Tips
Post by: Deep Toaster on October 19, 2010, 07:25:13 pm
Was that the OS for the 84+ keypad, though? It's not on TI's site...

But I don't think we're allowed to exchange OSes by PM.
Title: Re: Optimization Tips
Post by: DJ Omnimaga on October 20, 2010, 02:25:08 am
Optimization's not really important on the Nspire, especially small stuff like that (it's more for the 83+/84+ series), because the Nspire's already so fast. Unless you're making something really complex, and then you'd need to look more at the bigger stuff (like moving things out of loops).
Keep in mind that not optimizing just because the platform is just fast enough is a bad practice if abused, though. On the 84+, I notice several games that runs just fast enough in BASIC but the same games were made on the 83+ years ago and ran 2x faster, because people spent more time optimizing. If a platform is faster, you don't have to worry as much about optimizing, but you must not get bad habits of just writing unoptimized code.