I’ve decided to make a tutorial/guide thing for TI-BASIC (that’s the programming language on Texas Instruments calculators) because….well, I want to. Hopefully people find it useful.
Before we get started with the mechanics of TI-BASIC, it’s important to say a few general things about programming:
1. There’s four main things that happen in a program. Input is what the user puts in. Output is what the calculator spits back out.
Control flow is what the programmer uses to adjust the ‘flow’ of a program (programs are ‘read’ from top to bottom, so you need to specifically state when it shouldn’t be), and finally ‘operations’ (I just made that term up) that let you modify the input and output.
2. It’s very important to know what you want a program to do before you make it. It’s no good to say “I want it do check my answers for math class”. You need to say “I want it to ask me for two numbers, add the two numbers together, and then display the result.”
3. Thinking is required. All of it doesn’t just come naturally, sometimes you need to sit down and think out what the best way of doing something is.
So, that said, let’s start with–well, how to make and run a program on your calculator.
Turn your calculator on (a lot of this is easy.) And press the PRGM on it. If you have a TI-86/85, press F2 (Edit), and type in a new name for your program. If you’re using a TI-80/81/82/83/83+/83+SE/84+/84+SE, scroll over to the “Create New” tab, and type in a new name. (Note: I didn’t include TI-89s in the list because I don’t have one. If you send me one, I’d be more than happy to include it in this guide
After you type in the name, and press ENTER, you’ll see a screen that says
PROGRAM:A NAME
:
Where A NAME is the name you typed in.
Pressing QUIT will exit the Programming screen, save the program, and return you to the home screen all in one.
So now that that’s taken care of, let’s write a simple program. There’s a tradition among programmers to always use “Hello World!” as a first program. So
open up a new program and call it HELLO. Now let’s take a moment and think about this. You want the program to say “Hello World!” when it’s run. That’s output. There’s no input necessary. You don’t need to control the flow, because the calculator doesn’t need to react differently to anything, and finally, since there’s no input, no operations need to take place.
So press the PRGM button again. You should see a menu labelled Ctl, that has stuff like If, While, For, End, etc. Scroll over one, to the I/O menu, and select the Disp option. Disp stands for “Display”, and is the command to display something on the screen. After the Disp, type in: “Hello World!”. Now your calculator knows to display something, and it knows the thing to display is ‘Hello World!’.
PRGM: HELLO
isp “HELLO WORLD!”
Run the program by quitting, hitting PRGM, and selecting ‘HELLO’. This’ll paste something onto your home screen. Press ENTER to run the program.
prgm_HELLO
HELLO WORLD!
Done
Round two: Basic BASIC input and math.