Skip to content
HN On Hacker News ↗

TI-83 Plus BASIC Programming Tutorial: A Beginners' Guide

▲ 198 points 89 comments by suoken 3w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

1 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 6 of 6
SEGMENTS · AI 0 of 6
WORD COUNT 1,785
PEAK AI % 3% · §1
Analyzed
May 7
backend: pangram/v3.3
Segments scanned
6 windows
avg 298 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 1,785 words · 6 segments analyzed

Human AI-generated
§1 Human · 3%

TI-83 PLUS BASIC PROGRAMMING TUTORIAL:

A BEGINNERS' GUIDE v2.5

[Download This Tutorial] By: Boris Cherny

NOTE: In order to fully appreciate programming the TI-83+,

I suggest that you first get the Ti Graph Link 83+ Application

for your PC, which makes it easier to visualize and create the

program. I suggest you get the following applications for your

PC before you start programming:

TI Graph Link 83+, 83i Viewer, TI Connect, and an Emulator

You must also get the black serial cable or a TI Connect cable

in order to connect your TI and computer.

I will try to include these programs with this guide, as well as a few

programs for your enjoyment. You are free to tinker with them as

you wish. You may put them on the internet or sell them as long as:

You change them somehow You give Boris Cherny credit

I'd also like to thank a few people, who really helped me out with this tutorial:

~Ilya S~

~Tom T~

For Beginners, I suggest reading this tutorial from the very beginning

and trying every sample program, taking a shot at every challenge.

Have fun!

T A B L E   O F   C O N T E N T S

BEGINNING TOPICS

DISP Function OUTPUT Function CLRHOME Function LBL/GoOTO Functions END/PAUSE Functions MENU Function INPUT/PROMPT Functions STOP Function VARIABLES REVIEW

CYLINDER AREA ANSWER COUNTING ANSWER SIMPLE MOVEMENT ANSWER

MORE ADVANCED TOPICS

FOR Function WHILE Function Compare This IF, THEN, ELSE, and OR Functions STRINGS GETKEY

§2 Human · 3%

Function RAND, RANDINT, iPART, and fPART Functions LISTS MATRICIES REVIEW

ADVANCED MENU ANSWER MOVE ANSWER

DRAWING FUNCTIONS

CLRDRAW Function TEXT Function LINE, TANGENT, VERTICAL, and HORIZONTAL Functions SHADE Function CIRCLE Function Pt-On and Pt-Off Functions NESTED LOOPS

CHALLENGES

BEGINNING TOPICS

DISP Function

There are three ways to output text: DISP, OUTPUT, and TEXT. Right now I will be covering the most basic of these methods, DISP. This command displays a phrase on the next available line (the line closest to the top of the screen with no text on it). This command is accessed through PRGM>I/O>3. Remember to always start and end with quotes. Here is an example:

: Disp "TUTORIAL"

OUTPUT Function

Computers have a different coordinate plain than standard mathematics does; y starts at the top, while x starts at the left. The TI-83 Plus screen is 8 characters tall by 16 characters wide:

While the DISP function is an important command, you will find yourself using OUTPUT much more often. Unlike DISP, output prompts you for a certain location, or coordinate, to output your text, plus it has automatic text wrapping. This command is accessed through PRGM>I/O>6. Start and end with quotes. Here is an example:

: Output(3,2,"TUTORIAL")

SHORTCUT! It is also perfectly fine to negate the closing quote and parenthesis:

: Output(3,2,"TUTORIAL

CLRHOME Function

CLRHOME is an essential command, used for clearing the current screen (frame). It is usually initially used at the beginning of the program to clear the .prgm(name). at the top of the screen. Access it through PGRM>I/O>8. I suggest you make it the first command at the beginning of most frames.

§3 Human · 2%

Here is an example:

: ClrHome

: Disp "HELLO WORLD"

Notice that this time there is no annoying "prgmTUTORIAL" at the top of the screen before the main text.

LBL/GOTO Functions

The LBL command is used to label frames, duh. This command leads to sloppy coding, so only use it when you have to; you WILL have to. The GOTO command is used to go to a pre-designated frame. They are accessed by going to PRGM>9 and PRGM>0. Here is an example:

: Lbl A

: ClrHome

: Output(4,2,"HELLO WORLD"

: Goto A

This will keep flickering the text 'HELLO WORLD' on and off, until you press the ON button and select QUIT.

The frame is labeled 'A', and the text 'HELLO WORLD' is displayed at coordinates (4,2). Then the calculator is told to go back to frame 'A', clear the screen (CLRHOME), and output the same message again. This is all done at such a high speed that it just flickers 'HELLO WORLD'. This is quite useless, so we need some kind of command to stop this continuous loop, so it will actually be useful...which brings me to my next point.

END/PAUSE Functions

What would you do if you entered in a command, and it kept looping over and over, like the LBL/GOTO example? Well, the answer is simply to put something there to say that the loop has got to stop. The END command is used for ending loops or signifying that this is the end of the frame. END is used in such loops as FOR, WHILE, GETKEY, INPUT, and many others. The PAUSE command is used as a kind of dam, to wait for the user to press ENTER before continuing on to the next frame or step and the dam exploding and killing all the little villagers. They are accessed through PRGM>7 and 8.

§4 Human · 1%

Here is an example:

: Lbl A

: ClrHome

: Output(4,2,"HELLO WORLD"

: Pause

: ClrHome

MENU Function

Menus are widely used: to start games, to quit, to select a choice from a list... So how do you make one? The TI is already programmed with a neat little command called MENU. It is accessed through PRGM>C. Here is an example:

: Menu("--MENU--","BANANA",1,"ORANGE",2,"PEACH",3,"QUIT",X)

You cannot have more than seven items on the menu, because the screen is only 8 characters high, and the title takes up one of those lines. The first word in a menu is the title, and then the items, and what frame to go to if they are selected.

INPUT/PROMPT Functions

INPUT and PROMPT are two ways to get the same outcome. They are both commands to ask the user for some kind of input, be it number, letter, or essay. INPUT needs more attention, and cannot just ask for a number and end; but PROMPT can simply collect a variable and end its loop. INPUT can collect STRINGS, but prompt cannot. Later I will teach you how to compare the answer to a pre-set variable. This will lead into VARIABLES, because they must be used here. The commands are accessed through PRGM>I/O>1 or 2. Here are some examples and possible situations:

: ClrHome

: Prompt X

: Disp X

: Pause

: ClrHome

: Input X

: Disp X

: Pause

: Stop

: End

STOP Function

The STOP command overrides and stops any active processes. For example, in the previous example, we used STOP to end the process of asking for a variable and then outputting it. STOP is also commonly used to end FOR loops (explained later). STOP is accessed through PRGM>F.

VARIABLES

Variables are seen every day: in algebra, in logic, in science, geometry, etc. Since programming is a mix of math and logic, variables are used extensively in it. They are used for defining a number or string and then storing it as a single letter.

§5 Human · 0%

This makes it much easier on the programmer to call up a number (let.s say the number was 1,243,822,256,012,355,566,761). Variables are also used for numbers which change, and you do not know what its previous value was. For example, lets say a user.s score was 0, and you stored that value as the variable 'X'. During a game, you do not know if the user got the entire bonus, got any bonus at all, or got only partial score. In that case you would tell the calculator to save the user's score as the variable X, and no matter what it was before, the value would never be dependant on the previous value (e.g. X+10, X+100000, X-4, etc.).

: ClrHome

: 250A

: 500B

: Output(2,1,A

: Pause

: ClrHome

: Output(2,1,B

: Pause

In this example, the numbers 250 and 500 were stored as the variables A and B, to be later outputted at the coordinates (2,1).

REVIEW

CYLINDER AREA: Design a program to ask the user for the side length and radius, and then output the area of the cylinder.

CYLINDER AREA ANSWER

COUNTING: Design a program that counts from 0 to 2000, and displays every number, so you can see the numbers 0 through 2000 being displayed on the screen.

COUNTING ANSWER

SIMPLE MOVEMENT: Design a program in which, first, the user selects an option from a list: Up, Down, Left, Right, or Explode; and then, a single character is displayed which performs the function.

SIMPLE MOVEMENT ANSWER

MORE ADVANCED TOPICS

FOR Function

FOR is a function used, at a beginner's level, as a kind of wait function- it counts from the first number to the second number at intervals of the third number. It is also used to display something for a certain amount of time.

§6 Human · 1%

How it would work is for([variable A-Z], [starting number], [ending number] , [interval]). The lower the number the less time (duh). An END command must be put where you want the loop to end. Sometimes STOP is also used to force the loop to end. This command is accessed through PRGM>4. Here is a simple example:

: ClrHome

: For(A,0,50)

: Output(3,1,"THIS"

: End

: For(A,1,50,20)

: Output(4,2,"IS A"

: End

: For(R,9,500,10)

: Output(5,3,"TUTORIAL"

: End

The strings (lines of text) will appear one by one, FOR signifying to the calculator to keep the line up for the designated time before executing the next part of code. However, once the whole program ends, there is a final END, and the calculator automatically restarts the program once the user presses ENTER.

How END works behind the scenes: In this case, the calculator is told to save into the variable .A. the changing value of 0 to 50. Since Basic is such a slow language, .THIS. is outputted at the coordinates (3,1) for a few seconds, or how long it takes the calculator to count from 0 to 50.

WHILE Function

While is also a loop: it continues until a certain condition is true. However, unlike FOR, WHILE does not automatically add one to the value of a variable each time around; you must tell it to add or subtract a certain amount. This makes it more flexible of a loop. Here is an example of its use:

: ClrHome

: 1Y

: While Y16

: 1X

: While X8

: Output(X,Y,"+"

: X+1X

: End

: Y+1Y

: End

Here's the breakdown: The screen is cleared and the value of the variable 'Y' is set to 1. While Y is less than or equal to 16, make the value of X equal to 1. While the value of X is less than 8, output at the coordinates (X,Y) a plus sign (+).