Author Topic: Optimization Tips  (Read 4437 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Optimization Tips
« 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!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Optimization Tips
« Reply #1 on: October 17, 2010, 05:03:55 pm »
I'm guessing this is for Nspire BASIC?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Optimization Tips
« Reply #2 on: October 17, 2010, 05:08:14 pm »
ya, i think he has the nspire.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Optimization Tips
« Reply #3 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 ;) )

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Optimization Tips
« Reply #4 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).




ASHBAD_ALVIN

  • Guest
Re: Optimization Tips
« Reply #5 on: October 19, 2010, 04:58:17 pm »
Plus it has so much memory for programs too :P

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Optimization Tips
« Reply #6 on: October 19, 2010, 05:12:32 pm »
Really? I thought it was the same as the normal TI-84 Plus...




Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Optimization Tips
« Reply #7 on: October 19, 2010, 05:48:08 pm »
TI-84+SE, actually. Not too bad an amount. ;D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Optimization Tips
« Reply #8 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!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Optimization Tips
« Reply #9 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)?




Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Optimization Tips
« Reply #10 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

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Optimization Tips
« Reply #11 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?




Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Optimization Tips
« Reply #12 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.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Optimization Tips
« Reply #13 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.




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Optimization Tips
« Reply #14 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.