ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Archives :: News :: Column: "TI-82 BASIC Tips & Tricks Vol. 1"

Column: "TI-82 BASIC Tips & Tricks Vol. 1"
Posted on 27 August 1998, 05:04 GMT

A new column by David Dynes entitled TI-82 BASIC Tips & Tricks Vol. 1 has beed added to the Features section. This column gives helpful hints on how to optimize your TI-BASIC programs for size and speed.

 


The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.


Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
Jonathan Bates

WE KNEW THIS ALREADY!!!

     27 August 1998, 06:43 GMT

Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
DUy Nguyen

That was the most pointless piece of $hit I've read on this page. First of all, everyone knows these shortcuts. Secondly, BASIC is now obsolete due to ASM. 99.9% of all Basic games really suck and I doubt that yours will make a differenence.

     27 August 1998, 20:00 GMT


Re: Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
Flaming Idiot
(Web Page)

And your coment was most useless thing I've read on this page.

     28 August 1998, 16:15 GMT

Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
XaVIëR
(Web Page)

OK, guys.
I'm disappointed with your attitudes.
Pointless? No. I intended this article for those who don't have assembly. I agree, assembly is far superior, but BASIC is in no way obsolete. I don't have assembly on my calculators because I am not comfortable opening up the back and tinkering around with a $100 piece of equipment.
There are those who find BASIC very easy, and I just made what is easy faster and smaller too.
I think that you need to take into perspective that , there are those can't understand assembly, and don't want to risk screwing up their calc trying to fish out chips so they can have assembly.
Please, make room for some worthwhile comments. After all, EVERYBODY doesn't know this. Many do, but many don't. Please don't be so rash.

Ever trying to help,
XaVIëR

     27 August 1998, 23:25 GMT


Re: Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
Eric

What are you talking about? Taking apart your calc and taking out chips to have assembly? I know first hand that that isn't true, I got an 82, assembly programs, and the closest thing to being taken apart is when I take off the back cover to change batteries.

     28 August 1998, 01:15 GMT

Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
Jon Printz

I'm not sure this article is necessary to post on ti-calc.org. I'm sure there are alot of people out there who would benifit from reading this, but probably no one that would be interested in visiting this website. To me, if you don't have a graph link of some kind, alot of this site is more or less useless unless you want to sit and type in basic programs, and that isn't very fun. And I don't know of anyone who likes to sit and play basic games over assembly. I don't like the attitudes of the two who replied. So what if assembly is superior. The fact is alot of people don't have access to it, and are plenty of people who continue to make some pretty sad basic programs.

     28 August 1998, 00:23 GMT

Re: Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
XaVIëR
(Web Page)

<b><u>Thank you Jon!</u></b> Y'know, I hadn't intended this to be a column, but an article. I'm glad you see my message, and appreciate the criticism. But those at TiCalc believe it is worth being up. If assembly logs are allowed, why not something for those who can't get assembly?
Honestly, I almost feel like an Amish gent here, *LOL* but I am dedicated to the BASIC programmers. I agree, there are plenty of BASIC games that completely suck, but there are indeed some that make programming an art, and I believe they make great BASIC programs! I hope you got something out of this, Jon, and best of luck.

     28 August 1998, 01:28 GMT


Re: Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
Bryan Rabeler
(Web Page)

This site supports assembly as well as BASIC. True, we tend to cover assembly the most, but believe it or not, people still use and program TI-BASIC. I am sure this column will be useful to some people, at least those starting to learn TI-BASIC.

     28 August 1998, 02:19 GMT


Re: Re: Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
Jbrett

Nice comment, Bryan. You two at the top need to shut up. This is very good for beginning programmers. For some people, BASIC is tough. I know that may be hard to believe, but it's true. I would have been very grateful if I would have had this back when I started programming a long time ago. I had to learn BASIC off of my friends' calcs with no help at all. Now I am an intermediate ASM programmer, but I still use BASIC every once in a while for small useful programs that don't need to be small or very fast.

     28 August 1998, 23:17 GMT

Re: Column: "TI-82 BASIC Tips & Tricks Vol. 1"
XaVIëR
(Web Page)

I geared this toward those who don't have assembly, can't have assembly, or would just rather learn BASIC first. Due to the positive, helpful feedback, I am going to write a second column, which will not only add new tidbits, but also update the first.
Like JBrett, I had to learn BASIC with nothing but that dry, confusing manual without these little helpful tidbits.
Games, also, need not have dazzling graphics to be good. Some of the best games, on PC and on these calcs, is totally text based, without graphics whatsoever, for example: Colossal Cave, for PC. Remember when fullsized desktop computers were slower than Ti-81's?!?
I spent over a year learning BASIC, and now I wish to give others the help I did not have.
When one skim others' source code, sometimes even those who can program like an expert have to stop and say "What kind of garble is that?"
BASIC can be tough, and my duty here is to make it a little bit easier. :)

I hope you all continue to post comments and email me further with answers, and questions also. I'd be glad to help.

Ever trying to help,
XaVIëR
David Dynes

     29 August 1998, 01:18 GMT

"Fatigue"
Jeff Min
(Web Page)

I think this "Program Fatigue" you're talking about is caused by some recursion. GOTO's and LBL's are both perpetrators and sometimes it's hard to work around them. Avoid these two commands at all costs. I'd say to try using WHILE and WEND (is that right? or is it just END?), but even that seems to cause "fatigue."

     29 August 1998, 07:31 GMT


Re: "Fatigue"
XaVIëR
(Web Page)

Jeff:

I agree that there is severe recursion, and that both Goto and Lbl are sinister, but While and Repeat are used with logic, to replace If and If-Then-Else-End statements.
Oh, There is no WEND command, it is just End.
The only alternative I have seen beside Lbl's and Goto's is to have multiple execs, which run as subroutines with each other, which messes up your PRGM menu, and can get confusing.
There are ways to guarantee that firing up any subroutine can start the start program, which I will include in my second column.
Thanks Jeff. You've helped. :)
Ever helping those who need it,
XaVIëR

     29 August 1998, 19:19 GMT

The Real Reason for Program Fatigue
PG

To tell the truth, you are all wrong about the reason for program fatigue. It doesn't matter how many Goto's or Lbl statements the program has. It happens because the program never reaches the End statement to terminate a loop.
For example:
Lbl A
1->A
If A==1
Then
Goto A
End

The program above will never reach the End statement because it keeps skipping it when it jumps back to A. The prog then keeps entering the loop thinking the last loop hasn't ended. The uneded loops are stored in memory and slow down the prog until it eventually crashes and you get a MEMORY error.

Example 2:
Lbl A
1->A
If A==1
Goto A

The program in example 2 could run for hours and still never slow down.

     1 September 1998, 00:09 GMT

BASIC Hints
Rudi.83g  Account Info

I have read in many posts that For( loops were slow. I measured the "instruction timing" of some BASIC instructions on my TI-83:

empty lines or :s 0.5 ms

prgm 4 ms
"COMMENT 150 ms, SO AVOID COMMENTS!
single-line If, true 4 ms
single-line If, false 3 ms

UPTO loops (1 to N)
Repeat:
:0->K
:Repeat K=n
:K+1->K
:(your code here)
:End 320 130 50 21
While:
:0->K
:While K!=n
:K+1->K
:(your code here)
:End 320 130 50 25
For:
:For(K,1,n)
:(your code here)
:End 66 30 12 7
(times are ms for 25, 10, 3, 1 iterations)

If you use downto loops, While loops can be optimized by a bit (~ 0.5%)
For gets slower if you specify the step width (15 %)

BUT FOR IS THE FASTEST!

GOTO: 0.5 ms per token from the beginning of the program
Pxl-on, Pxl-off 4 ms
Pxl-change 5 ms
pxl-test 6 ms
Pt-on, Pt-off, Pt-change 7 ms
Output 6 ms + 1 ms per character to output
randInt 40 ms
rand 35 ms

-> 3 ms
Ans 1.5 ms
<variable name> 2 ms
<storing into Ans> 1 ms

     29 June 2000, 15:15 GMT

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer