Disaster
Name: Hash 2X
Author: Bxsciencer (aka Jason Lee)
Download: Hash2x.zip
Compatibility: Parent page not set
File Size: 1356 bytes

This is a multivariable hash function that I created. Its pretty fast (especially on a computer), and can have outputs of any size greater than 8 (any less is ridiculously insecure, although a simple edit to the program will allow for any output size greater than 0). However, due to the limitations of the 83/84, 256 is the max inputs and outputs for the moment. The outputs are stored in Str1, so they can be recalled.

There has been no editing of anything except for the files included in this download.

PS. Any help in analyzing this algorithm is most welcome and greatly appreciated.

The code below allows you to move an X around on the home screen, within the boundaries of the four sides of the home screen. This is the same screen that you perform math on and execute programs from. You can end the program by pressing 2nd.

:4→A
:8→B
:Repeat K=21
:getKey→K
:If Ans
:Output(A,B," // 1 space
:min(8,max(1,A+sum(ΔList(Ans={25,34→A
:min(16,max(1,B+sum(ΔList(K={24,26→B
:Output(A,Ans,"X
:End

Why This Works

This code is a collaboration of many optimizations by many members of the ti-basic community. The first lines have always been the same, just initializing the beginning coordinates as a starting point. 4 and 8 are used preferentially because these set the guy at the center. You may use variables other than real ones such as lists, matrices, and strings, but the best way to program this specific example is to use real variables and Ans. Those of you who are somewhat familiar with TI-Basic may have noticed that I have left off the ClrHome command at the beginning of the program. This is for optimizational reasons, and in some cases ClrHome may not be necessary anyway.

:4→A:8→B

After initializing the variables, we then start the main program loop. The main program loop contains the primary code that will be repeated while the program is running. While we could have used any one of the three different loops that exist in TI-Basic for the main program loop (i.e. While, Repeat, or For), the Repeat loop was chosen because it always loops at least once. This allowed us to skip initializing the variable within the loop's condition. The loop condition will be explained later.

:Repeat K=21

Next we read the keypresses of the user with the getKey command. This information is stored into a variable because it is useful to determine when the main program loop should end and to move the X character around the screen. I have chosen the K real variable because 'K' is the first letter of keypress, so it makes it easy to remember what the variable is being used for. While this is primarily just a personal preference, it is good to consistently use the same variables for the same purposes in a program. It's not that important in this program because it is small, but it is definitely important in large programs. After programming for a while, you will begin to develop a habit for which variables you use. Just remember to be consistent.

For some reason, people used to put an extra loop condition around the getKey. We no longer do that because we check if there was a keypress near the output command.

:getKey→K

We then check for the keypress value. The Ans variable assumes the value of the last variable the calculator stored, and because the variable was on the line above, we can use the Ans variable instead of K.
You might be asking why we even need a conditional there. Couldn't we just have the getKey command by itself? Wouldn't that work just as well? While the program would run the same way, the program would not look the same. The conditional is there to prevent flickering when no key has been pressed but the X is erased anyways.

:If Ans
:Output(A,B," // 1 space

The next two lines are the most complicated, yet most important in the entire program. They are used for moving the coordinates of the X character around on the screen. Each of the two coordinate variables A and B is modified using a complicated routine based on the key that was pressed.

:min(8,max(1,A+sum(ΔList(Ans={25,34→A
:min(16,max(1,B+sum(ΔList(K={24,26→B

Now, you are probably wondering why we just didn't use four separate If conditionals instead of combining them into two large math expressions? Why does it need to be so complicated? The reason is that using four If conditionals would slow down the program considerably, and the code would be much larger. If you're not convinced that the piecewise expressions eliminate the need for If conditionals in this program and/or that If conditionals would slow down the program, try using the four separate If conditionals and see the affect for yourself. As I want to drive home the point, I have provided the If conditionals code below for you to type into your calculator. Please do type it in and see for yourself because that's the way you learn and grow as a programmer.

:If K=25 and A>1:A-1→A
:If K=34 and A<8:A+1→A
:If K=24 and B>1:B-1→B
:If K=26 and B<16:B+1→B

This is how this code works. When you press a key, its value is stored to K. We check to see if K equals one of the keys we pressed by comparing it to the lists {24,26 and {25,34. This results in a list {0,1}, {1,0}, or {0,0}. We then take the fancy command Δlist( to see whether to move up, down, left or right. What Δlist( does is quite simple. Δlist( subtracts the first element from the second in the previous list, and stores that as a new one element list, {1}, {-1}, or {0}. We then turn the list into a real number by taking the sum of the one byte list. This 1, -1, or 0 is added to A.

After this, we compare A to 1, and take larger of the two, to make sure the coordinate isn't too low. That number is compared to 8 or 16, to make sure the other coordinate isn't too high. This number is stored as A or B, and thus we have our formula.

After adjusting the two coordinate variables, we then display the X character at its new position on the screen. Since the Ans variable currently contains the B variable's value, we can use Ans instead of B for displaying the column. It is completely preferential whether you do this, but developing optimizational habits is good for when you make larger programs and speed really matters. It is left in to show what the optimized version of the program looks like.

:Output(A,Ans,"X

Finally, we close the main program loop with an End command. The condition in the loop is tested when the program reaches the End command, so the program will now check the K variable to see if the user has pressed 2nd.

:End

And thus we have the full movement code.

Graph Screen

The differences here are that we need to start by setting up window coordinates, which can be found here, we need to change the start points and limits of the variables to the appropriate X,Y coordinates, and the display routine is able to use only one line function do to its optional fifth argument. This argument determines whether to turn off pixels or turn them on. We manipulate this fact by checking if K has been pressed algebraically. Here is the full code.

:Zstandard
:104→Xmax
:72→Ymax
:Zinteger
:1→A
:1→B
:Repeat K=21
:getKey→K
:Line(A,B,A,B,not(K
:min(94,max(0,A+sum(ΔList(K={24,26→A
:min(62,max(0,B+sum(ΔList(K={34,25→B
:End

Author

Program Description

PLEASE REMOVE the following words that do NOT describe your program:
Arcade Graphics Platform Puzzle RPG Strategy Sports Casino Board Utility Misc

http://tibasicdev.wikidot.com/local--files/home/no_image_2.png

Unavailable

Program size in bytes

Name: Roman Numeral Converter
Author: patriotsfan
Download: TIBD04.zip
Compatibility: Parent page not set
File Size: 388 bytes
This program converts Arabic Numerals to Roman Numerals. It does not use any strings!

Routine Summary

Returns a list of the frequency of values in another list sorted.

Inputs

L₁ - the list you want to find the frequency of

Outputs

L₂ - the values of L₁ without repetition sorted
L₃ - the frequencies of the values in the list L₂ sorted

Variables Used

L₁, L₂, L₃, θ

Calculator Compatibility

TI-83/84/+/SE

Author

Galandros

URL: United TI

Download

listfrequency2

:DelVar L₂DelVar L₃SortA L₁
:For(θ,1,dim(L₁
:L₁(θ→L₂(1+dim(L₂
:sum(L₁=Ans→L₃(dim(L₂
:θ-1+Ans→θ
:End

In the first line we initialize L₁, L₂, and L₃. We sort L₁ so like values will be adjacent.

Then we start looping by storing the first value encountered to the next element of list L₂.
In the next line we find the frequency of the value already stored in L₂ and is stored to the correspondent element in L₃. θ is increased by the frequency found minus 1 to pass to next number, but then incremented by 1 in the For loop.
We loop we reach the end of L₁.

And that's it. The output is put on L₂ and L₃ already sorted. Notice how well Ans is used for speed and size optimization.

When you are done using L₁, L₂, and L₃, you should clean them up at the end of your program.

The ListPages module does not work recursively.

{$tutorialsBegin}

Besides reading the programming information that this wiki provides, there are several additional quality TI-Basic tutorials that other people have created that you might find handy.

Name Author
Complete TI-Basic Optimization Guide Arthur O'Dwyer
1337 Guide to TI-Basic Jonathan Pezzino & Kerm Martian
Making TI-Basic Shells Patrick Stone
2D TI-Basic Sprites Alex Snyder
Advanced Thinking Fred Sparks
No-Lib Guide to Sprites and Maps Thomas Dickerson
TI-Basic Greyscale Kevin Ouellet
TI-Freakware Tutorials Daniel Thorneycroft
Complete TI-Basic Tutorial Kerm Martian
BASIC Guru Tutorials Ben Ilegbodu
MJS 2000 Tutorials Unknown
Rogue's TI-86 Basic Tutorial Andrew Matta
HeaneySoft BASIC Tutorial Wayne Heaney
TI-83 Programming Tutorials Lue Her & Andy Becker
TI-Basic for Noobs Matt Lee

{$tutorialsEnd}

{$utilitiesBegin}

While the calculator itself is the predominant place to program TI-Basic, another viable option is programming on a computer. There are several computer tools available, which provide a very rich programming environment.

Name Author Description
SourceCoder 3 Kerm Martian This is an online editor that parses TI-Basic code and presents it with the appropriate tokens. It can convert .8xp fies to source code, as well as let you edit and create programs online and export them as .8xp files. The latest revision adds image tools to parse and create .8xi images, png files, sprites, and more.
BasicBuilder Martin Warmer Programs with lots of subroutines get annoying rather quickly. BasicBuilder solves this issue by allowing you to compile all programs, subroutines, and pictures into a Flash Application. It also compresses your programs, saving some memory.
CalcCapture André Felix Miertschink Most commonly used in conjunction with Flash Debugger, CalcCapture allows you to take still or animated screenshots in gif format of any running Windows program.
TI-Graph Link Texas Instruments This program is used for programming TI-Basic on the computer. It has an easy-to-use interface, featuring all of the menus and functions of the calculator itself. In addition, it is used for transferring files back and forth between the computer and calculator.
JALcc IDE Stef Mientki Editing TI-Basic has always been a rather slow, tedious process because of the screen limitations and the fact that distinguishing the code can be difficult. JALcc solves this problem by utilizing code-coloring commands, indenting nested commands, and allowing you to make large multi-line comments.
Manual Texas Instruments Even if you have a physical copy of the manual, an electronic copy is still needed. It is much more convenient to just open up the electronic manual, then to have to carry the physical manual around.
Online TI File Converter ZeWaren Can create and convert data from many calculators, such as the TI-82, TI-83, and TI-83+/84+.
Rom8x Andree Chea With the difficulty of getting ROM images from the newer calculators, this program allows you to bypass that problem. It is most useful for those with a USB cable.
TI Connect Texas Instruments This program is the updated version of Graph Link. It primarily features faster speed because it works with the USB cable. However, it does have compatibility issues with the newer calculators.
VTI Capture André Felix Miertschink Works with VTI to get screenshots. It allows for both still and animated screenshots and has extra features like contrast adjustment, adding extra borders and some others.
TiLP Romain Liévin A linking program for Linux and Windows. It works on Vista 64 bit, while TI-Connect does not.
TI-Connect CE Texas Instruments A linking program for Windows and Mac. It includes an updated GUI and a simple code editor.

{$utilitiesEnd}

{$oncalc-utilitiesBegin}

There are many programs that will assist your programming on-calc, such as in the creation of games or sprites.

Name Author Description
ASCII Editor Robin Peters This program allows programmers to simply create single and dual layer maps, as well as get tokens that are normally not available on the calculator and easily try different combo's of tokens. The programmer then can use the map for his/her RPG, sidescroller, puzzle or maze game, etc.
Basic MapMaker MDR Falcon This helps programmers create maps in basic, without the hassle of typing in a long string or matrix.
Lunar IDE Jonah Scheinerman This is an on-calc program editor, with many built-in tools to allow more ease when programming.
Random Maze Generator James Pruit This program generates random 9x9 mazes that can be used in your own programs.
RPGSK2 Daniel Thorneycroft This helps programmers learn how to use 4 way scrolling ASCII maps.
Symbols Daniel Thorneycroft & Kerm Martian This allows programmers to use any of the 131 symbols normally unavailable in Basic programs.
Text Sprite Finder Robert Moy This helps programmers create text sprites for use in their own programs.

{$oncalc-utilitiesEnd}

{$emulatorsBegin}

An emulator allows you to run a virtual form of your calculator on your computer, which is very convenient when you want to make quick changes to programs, or do any debugging or optimizing.

Name Author TI-83 TI-83+ TI-83+SE TI-84+ TI-84+SE TI-84+CSE TI-84+CE
Emu8x Michael Vincent X
Flash Debugger Texas Instruments X X
TilEm Benjamin Moody & Solignac Julien X X X X X
PindurTI Patai Gergely X X
VTI-Alpha Corey Taylor & Rusty Wagner X X
VTI-Beta Rusty Wagner X X
WabbitEmu (WIN) Spencer Putt & James Montelongo X X X X X X
WabbitEmu (MAC) Spencer Putt & James Montelongo X X X X X X
jsTIfied Christopher Mitchell X X X X X X O

{$emulatorsEnd}

{$related-sitesBegin}

There are many TI sites out there, providing their own set of services and features.

Ticalc.org Omnimaga Cemetech CodeWalrus TI-Planet
CalcGames TI-Freakware RevSoft MaxCoderz TI-Story

{$related-sitesEnd}

Name: Decimal to Roman Numeral Converter
Author: Zaphod_Beeblebrox
Download: Roman.zip
Compatibility: Parent page not set
File Size: 187 bytes
Converts a decimal number to a roman numeral.

output.png

Command Summary

Output is used to display text to pixel coordinates on the Program I/O screen.

Command Syntax

Output row,col,text

Menu Location

Starting in the program editor:

  • Press F3 to enter the I/O menu.
  • Press 6 to paste Output.

Calculator Compatibility

This command works on all calculators.

Token Size

2 bytes

The Output command is the most basic command for displaying text. It can display any type of expression on the Program I/O screen in the large font, using "Pretty Print" if it is enabled. It uses (row, column) pixel coordinates to determine the top left corner from which it displays the expression. By far the most common use of Output is for displaying strings.

:Output 20,20,"Hello, world"

Advanced Uses

Both the row and the column coordinates for displaying text can be arbitrary integers — they can be negative, and they can go off-screen. The portion of the text that fits on the screen (if any) is drawn, and the rest is omitted: there is no wrapping of any kind.

Related Commands

The ListPages module does not work recursively.
Name: Byte Converter
Author: RandomProductions
Download: ByteConv.zip
Compatibility: Parent page not set
File Size: 1619 bytes
Byte Converter allows you to convert between units of memory from the bit to the terabyte, even nybbles. The units follow the IEC standard of Kibibytes, Mebibytes, and so on, but are written as Kilobytes, Megabytes, and son.
Name: challenge 4
Author: noah maddox
Download: Roman.zip
Compatibility: Parent page not set
File Size: 419
my entry to challenge 4

This is how the calculator really works. The following is based on my knowledge of how computers work. Since the calculator at this point is a computer, I thought this knowledge of mine would come nicely. I will have analogies referring to computers, but that's to be expected in this article

On, Sleep, On, Sleep, On, Sleep…

Yes, it's true. Your computer only turns off when it "crashes". Read on.

On for the Very First Time

When you unpackage your new TI-84+ and turn it on, you're turning it on from a complete off state, as if you turn on your computer for the first time.

Off? Try Sleep

Every single time you press the off button, you're actually suspending the calculator's activities. Basically, putting the calculator to sleep, like on a computer.
In the old days of TI calculators, when calculators ran on AC power and required special "modules" in the back to work, when you turned off the calculator, it was off. Any programs you had written were lost, because they were in the RAM. Nowadays, the calculator just goes to sleep.

Crashed Calc!

When your calc crashes, you are forced to turn it off, by taking out a battery. This is the same as your computer freezing up, and requiring you to hold down the power button for a few seconds. This is the only way you can force your calculator off, by causing it to crash. At this point, it says RAM Cleared like it is a scary thing, but it isn't.

Final Notes on Calculator RAM

It seems funny that RAM on a TI-83 and RAM on a computer are viewed as two completely different things, when they are exactly the same. A program that is in the RAM on the calc is like an unsaved document on your computer. The RAM Cleared message you may get really says, "Your calculator turned off completely, and it cleared the RAM like your computer would if you turned it off." The RAM on your calc acts like any other RAM in computers.

neural network

Introduction

Artificial intelligence, often abbreviated AI, is a branch of computer science concerning the intelligence of machines. More specifically, artificial intelligence is the ability of inorganic automaton to perceive their environment and make rational decisions based on data acquired. Used in applications with dynamic environments, as opposed to static, AI attempts to provide solutions to problems without the need of human interaction. The entire purpose behind utilizing AI is to allow automata to make decisions as if it were human. In essence, AI is an effort to emulate the human mind in settings where a real human would be impossible or impracticable to use.

Characteristics of AI

In the game industry, AI allows a CPU to compete against a human player (or another CPU) under the rules governing the game. For example, a chess AI will analyze the game and attempt to make moves which will maximize its success. Other examples of AI include speech recognition used in cell phones, automatic thermostat controls, and the navigation system used in autonomous robotic vacuum cleaners. In each of these applications, AI combines multiple elements together to complete a task based on the data presented. Breaking the AI into individual qualities allows these elements to be characterized.

In order for a system to be considered artificially intelligent, it must exhibit at least three established characteristics. These characteristics are referred to as the “three A’s”; acquire, analyze, action.

Acquire

An AI system has the ability to make observations about its environment.
Whether the observations are physical or purely numerical, they represent data acquired by the AI.

Analyze

An AI system has the ability to evaluate the data acquired and arrive at a conclusion. A chess AI will analyze board piece locations to determine a set of possible actions which will maximize its probability of winning the game.

Action

An AI system has the ability to make rational choices based on the conclusion of the analysis. This characteristic is especially important as it represents the AI’s function as an agent. In other words, the AI has the ability to choose its course of action, doing so in a rational manner.

The three A’s were specifically chosen in order to differentiate true AI from what is otherwise an automated entity performing a predetermined set of tasks. Industrial robots may appear to have AI; however, they are simply machines following programmed instructions. They do not have the ability to acquire nor analyze environmental data. Another misleading use of the word AI is toward game opponents. Often, game opponents that give the impression of being artificially intelligent are nothing more than controlled systems abiding by a set of rules according to the current situation. An example would include Goombas and Koopa Troopas commonly found throughout many Mario series. They do not have AI since they do not possess the defining characteristic of action. In other words, they do not have the ability to make choices. Although Goombas and industrial robots do not have AI, this doesn’t mean that they could not utilize AI.

For example, the industrial robot could be equipped with a humidistat and sound level meter in order to collect data about environmental humidity and decibel levels respectively. The robot could then analyze the information and make decisions based on the results of the analysis. A possible action may be to activate evaporation fans if the humidity rises above a certain level or to reduce operation speed if the environment decibel levels exceed regulation. While less independent, as may be associated with AI, the industrial robot in this proposed setting abides by the rules established for characterizing artificial intelligence. The robot has the ability to acquire, analyze, and take action based on environmental data, making rational decisions towards achieving a goal.

Understanding AI

Developing artificial intelligence involves critical thinking and requires an interrogative approach towards its application. It is often necessary to analyze human thought patterns when designing an AI. The process through which an individual arrives at a conclusion in a game of checkers is likely similar to the sequence of steps an AI should take to maximize competency. Thus to better understand artificial intelligence, it is worthwhile to consider the entity from which it is being modeled, the human brain.

With estimated 50-100 billon neurons and approximately 100 trillion synaptic connections linking the neurons, the human brain is arguably the most powerful computer in existence.

Prerequisites

Logic

In order to take action based on what it analyzes, an AI must use logical and conditional statements pertaining to the operation it has been programmed to do. For example, in a game of "Tic Tac Toe", the AI must be able to use logic statements to determine where to place the next 'X' or 'O' in order to either block its opponent or complete a 3-in-a-row for itself. Logic statements can also be used to put certain actions at a higher priority than others. For example, a "Tic Tac Toe" AI will attempt to complete its own 3-in-a-row before blocking the opponent, because if it has already won, then the game is over and there is no chance of the opponent winning.

Procedural Programming

Control Flow

Data Structures

Environment

Code Structure

Gather Variables

Components

Thinking like AI

To program an AI you must think like one. You must not think like you would because if you were making the move in "Tic Tac Toe", you would reason on which move would be better, but the Calculator can't do this. All it can do is execute your code and make choices depending on whats true at the time and what your code tells it to do.

Conditionals

Conditionals are programming objects that check if an event is true and run a section of code if it is. In Ti Basic, the most applicable conditional for AI is If, and less common, While(, Repeat(,
For(, IS>(, and DS<(. Conditionals are the easiest way to reach an action from input information (it represents Analyze of the "three A's").

Probability

In a game that contains random elements as a mechanic, such as dice, cards, and spinners, a good AI must account for them in a logical manner. One way to implement this would be to do a weighted average of all the possible options, based on the likelihood of each outcome and a calculable value for how well the game is going.

Methods

There are many methods that an AI can use to calculate a move, each with their own strengths and weaknesses. These are some of the most popular.

MiniMax

MiniMaxing is a method of AI in which each possible move is plotted on a tree, the computer finds the most achievable end state, and takes moves to reach that state. Note that the end state does not have to be the best possible state; for example, a MiniMax "Tic Tac Toe" AI won't try to attempt 3 in a row assuming that its opponent won't try to stop it. Instead, a MiniMax AI assumes that its opponent will make the best possible moves, and then find moves that lead to the worst possible 'best' moves: in other words, the minimum maximum. MiniMaxing is suited for AI that should play perfectly, and thus might not be a good fit for a fun game opponent. This approach works best for smaller, shorter games like "Tic Tac Toe" where there aren't too many moves to plot, and the number of possible moves decreases over time. MiniMaxing in a game such as "Chess" is much more difficult, due to there being an increasing, large number of moves, so much so that such an endeavor is currently infeasible. MiniMaxing also doesn't work well for real-time games where each 'turn' happens every interactable frame.

Decision Tree

The decision tree AI is the most common and the most applicable AI in video games (and is also the easiest to implement on a graphing calculator). A decision tree's foundation is the conditional. The programmer codes in certain events, has the computer check if those events are true, and then has it run code if it is true. For the game "Tic Tac Toe", the programmer might have the computer check if it has a 2 in a row on the board. If so, then they will have it choose the 3rd empty tile. This approach to AI is the best suited for games due to its logical, predictable, and easy to implement system of conditionals. Because of the decision tree's simple nature, it is by far the best choice for TI Basic.

Self-Learning

First of all, letting a calculator learn is not really possible, however it is possible to let it remember and compare, thus creating the illusion it has learned. Let's see an example, "Tic Tac Toe", in this game it could be possible for the program to store all the games it played in lists, whenever the program can't figure a good move using the normal routine it can refer back to the lists and compare the list with the actual situation, now if the situation matches it could give a good move based on what it did good or bad in the list it is comparing to. This way of learning would prevent the human player from applying the same tactic over and over again, ergo, the machine seems to have learned what to do when this "tactic" appears. A good example of Self learning is deep blue, this was a machine developed by IBM that won a deciding chess game against the best human chess player at that time.

Conclusion

work in progress

Name: Action Identifier
Author: Aaron Gaba
Download: ActionID.zip
Compatibility: Parent page not set
File Size: 1,671 bytes
A little chemistry that helps determine chemical and physical changes. Includes also a "textbook guide" to the 5 indicators of a chemical change and a built-in help guide.
Name: Codon Analysis System
Author: Aaron Gaba
Download: CAS.zip
Compatibility: Parent page not set
File Size: 12 KB
A biology program which transcribes basic codons, tells you the amino acid it codes for, and gives the tRNA anti-Codon.
Name: Spider
Author: Builderboy2005
Download: Spider.zip
Compatibility: Parent page not set
File Size: 2358 Bytes
The simple game of Spider entails arranging the pipes so the spider can crawl through them for as long as possible. There are 3 Difficulty settings which enable extra pipe sections, and make the spider move faster. A highscore table is avaailiable so you can boast to your Friends! An Angel Production.
Name: Six Differences
Author: BuilderBoy2005
Download: SixDiff.zip
Compatibility: Parent page not set
File Size: 4152 Bytes
An Angel production! In Six Differences, you attempt to find the six differences in the two pictures displayed side by side on your calculator. Has 9 well designed levels, with a feature to install multiple level packs, AND a custom level editor. Uses a revolutionary system to store levels as a series of lines, which eliminates the need for picture variables, allowing the entire game to be hosted in One Program! Create your own levels! Install new level packs! Find the Differences!!
Name: Exact Quadratic
Author: noah maddox
Download: Quad.zip
Compatibility: Parent page not set
File Size: 694 bytes
An exact quadratic solver displays answers in "pretty print" look at picture to see
Name: program challenge 3 entry
Author: graphmastur
Download: Animation.8xp
Compatibility: Parent page not set
File Size: ?
This is my entry to program challenge 3
Name: Collect! (beta)
Author: Architeuthiskid
Download: Collect.zip
Compatibility: Parent page not set
File Size: Close to 3000 bytes for both versions
In collect, you go around and collect the dots that appear as soon as you eat the previous one. It is almost exactly the same as snake, with the major difference that the dot does NOT grow. If you move 100 times, or hit one of the walls, it's game over. For further info, look at the readme. Remember, this is a beta version, so it is lacking in many features that I will add later.
edit: I can't upload the new versions, due to computer difficulties.

Routine Summary

Returns the sum of digits of a number.

Inputs

X - the number you want

Outputs

Ans - the sum of X's digits

Variables Used

X, Ans

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

:sum(int(10fPart(Xseq(10^(-I-1),I,0,log(X

With our number stored in X, we loop through each of the digits of the number starting from the right using the seq( command. We get the respective digit by raising the number to the respective power of 10 and then multiplying the result by 10. The digits are returned separately in a list, and then we take the sum of them using the sum( command.

For example, if the number is 1234, we get a list of {1,2,3,4}, which then returns a sum of 10. You should note, though, that this routine only works with positive and negative whole numbers, and will return incorrect results if you try to use a decimal number. You could fix this problem by using the code below instead:

:abs(E13(X/10^(int(log(abs(X+not(X→X

Here, we obtain the appropriate power of ten by which to divide the number so as to leave only one digit to the left of the decimal point. Because a real variable may contain only 14 digits, the answer is multiplied by 10^13 to guarantee the removal of any fractional part. From taking the absolute value of this new result, our number can be safely entered into the routine above.

Note: It should be understood that this routine is only capable of adding the first 14 digits of a number. An input of π, for instance, would return 69 even though the sum of all digits of π is infinite.

Related Routines

Name: Chemical Equation Solver
Author: Edward Hou
Download: ChemEq1.0.zip
Compatibility: Parent page not set
File Size: 928 bytes
Balances chemical equations, inputted as a string.
All View Programs: TI-83 TI-83 Plus TI-84 Plus Upload Program: TI-83 TI-83 Plus TI-84 Plus
Name: Nibbles (Snake)
Author: Edward H
Download: Nibbles.8xp
Compatibility: Parent page not set
File Size: 580 Bytes
Nibbles is a version of snake, which is very graphical and very fast. This version of snake is unique because it doesn't use any list variables to control the movement of the snake.

A | B | C | D | E | F | G | H | I | L | M | N | O | P | Q | R | S | T | U | V | W | X | Z | Miscellaneous

Some commands have a superscript next to them that indicates compatibility:

  • 83+ indicates that the command requires a TI-83+, TI-83+SE, TI-84+, or TI-84+SE calculator.
  • 84+ indicates that the command requires a TI-84+ or TI-84+SE calculator.
  • 84+2.30 indicates that the command requires a TI-84+ or TI-84+SE calculator with OS 2.30 or higher.

Command Summary

Displays a list of most available commands in alphabetical order.

Menu Location

Press 2nd CATALOG to access the catalog

A

abs(
and
angle(
ANOVA(
Ans
Archive 83+
Asm( 83+
AsmComp( 83+
AsmPrgm 83+
augment(
AxesOff
AxesOn
a+bi

B

bal(
binomcdf(
binompdf(
Boxplot

C

χ²cdf(
χ²pdf(
χ²-Test(
χ²GOF-Test( 84+2.30
checkTmr( 84+
Circle(
Clear Entries
ClockOff 84+
ClockOn 84+
ClrAllLists
ClrDraw
ClrHome
ClrList
ClrTable
conj(
Connected
CoordOff
CoordOn
cos(
cosֿ¹(
cosh(
coshֿ¹(
CubicReg
cumSum(

D

dayOfWk( 84+
dbd(
►Dec
Degree
DelVar
DependAsk
DependAuto
det(
DiagnosticOff
DiagnosticOn
dim(
Disp
DispGraph
DispTable
►DMS
Dot
DrawF
DrawInv
DS<(

E

e
e^(
E
►Eff(
Else
End
Eng
Equ►String(
ExecLib 84+
expr(
ExpReg
ExprOff
ExprOn

F

Fcdf(
Fill(
Fix
Float
fMax(
fMin(
fnInt(
FnOff
FnOn
For(
fPart(
Fpdf(
►Frac
Full
Func

G

GarbageCollect 83+
gcd(
geometcdf(
geometpdf(
Get(
GetCalc(
getDate 84+
getDtFmt 84+
getDtStr( 84+
getKey
getTime 84+
getTmFmt 84+
getTmStr( 84+
Goto
GraphStyle(
GridOff
GridOn
G-T

H

Histogram
Horiz
Horizontal

I

i
identity(
If
imag(
IndpntAsk
IndpntAuto
Input
inString(
int(
ΣInt(
invNorm(
invT( 84+2.30
iPart(
irr(
IS>(
IsClockOn 84+

J

K

L


LabelOff
LabelOn
Lbl
lcm(
length(
Line(
LinReg(a+bx)
LinReg(ax+b)
LinRegTInt 84+2.30
LinRegTTest
ΔList(
List►matr(
ln(
LnReg
log(
Logistic

M

Manual-Fit 84+2.30
Matr►list(
max(
mean(
median(
Med-Med
Menu(
min(
ModBoxplot

N

nCr
nDeriv(
►Nom(
Normal
normalcdf(
normalpdf(
NormProbPlot
not(
nPr
npv(

O

OpenLib( 84+
or
Output(

P

Param
Pause
Plot1(
Plot2(
Plot3(
PlotsOff
PlotsOn
Pmt_Bgn
Pmt_End
poissoncdf(
poissonpdf(
Polar
►Polar
PolarGC
prgm
ΣPrn(
prod(
Prompt
1-PropZInt(
2-PropZInt(
1-PropZTest(
2-PropZTest(
Pt-Change(
Pt-Off(
Pt-On(
PwrReg
Pxl-Change(
Pxl-Off(
Pxl-On(
pxl-Test(
P►Rx(
P►Ry(

Q

QuadReg
QuartReg

R

Radian
rand
randBin(
randInt(
randM(
randNorm(
re^θi
Real
real(
RecallGDB
RecallPic
►Rect
RectGC
ref(
Repeat
Return
round(
*row(
row+(
*row+(
rowSwap(
rref(
R►Pr(
R►Pθ(

S

2-SampFTest
2-SampTInt
2-SampTTest
2-SampZInt(
2-SampZTest(
Scatter
Sci
Select(
Send(
seq(
Seq
Sequential
setDate( 84+
setDtFmt( 84+
setTime( 84+
setTmFmt( 84+
SetUpEditor
Shade(
Shadeχ²(
ShadeF(
ShadeNorm(
Shade_t(
Simul
sin(
sinֿ¹(
sinh(
sinhֿ¹(
SinReg
solve(
SortA(
SortD(
startTmr 84+
stdDev(
Stop
StoreGDB
StorePic
String►Equ(
sub(
sum(

T

tan(
tanֿ¹(
Tangent(
tanh(
tanhֿ¹(
tcdf(
Text(
Then
Time
timeCnv( 84+
TInterval
tpdf(
Trace
T-Test
tvm_FV
tvm_I%
tvm_N
tvm_Pmt
tvm_PV

U

UnArchive 83+
uvAxes
uwAxes

V

1-Var Stats
2-Var Stats
variance(
Vertical
vwAxes

W

Web
While

X

xor
xyLine

Y

Z

ZBox
ZDecimal
ZInteger
ZInterval
Zoom In
Zoom Out
ZoomFit
ZoomRcl
ZoomStat
ZoomSto
ZPrevious
ZSquare
ZStandard
Z-Test(
ZTrig

Miscellaneous

! (factorial)
° (degree-symbol)
r (radian-symbol)
T (transpose)
×√ (xroot)
³ (cube)
³√( (cube-root)
= (equal)
≠ (not equal)
< (less than)
> (greater than)
≤ (less than or equal to)
≥ (greater than or equal to)
□ (plotsquare)
+ (plotcross)
∙ (plotdot)
-1 (inverse)
² (square)
^ (power)
‾ (negative)
10^( (ten-exponent)
√( (square-root)
* (multiply)
/ (divide)
+ (add)
- (subtract)
{ (left list indicator)
[ (left matrix indicator)
( (left parenthesis)
} (right list indicator)
] (right matrix indicator)
) (right parenthesis)
, (comma)
' (apostrophe)
" (quotation)
: (colon)
π (pi)
? (interrogatory mark)

This variable-width character set is more common to the graph screen. For the larger font, please see this article.

Character Map

Click on any character to jump ahead and view its respective details.

0 1 2 3 4 5 6 7 8 9 A B C D E F
0 SrecurN SrecurU SrecurV SrecurW Sconvert SFourSpaces SsqDown Sintegral Scross SboxIcon ScrossIcon SdotIcon SsubT ScubeR ShexF
1 Sroot Sinverse Ssquare Sangle Sdegree Sradian Stranspose SLE SNE SGE Sneg Sexponent Sstore Sten SupArrow SdownArrow
2 Sspace Sexclam Squote Spound Sdollar Spercent Sampersand Sapostrophe SlParen SrParen Sasterisk SplusSign Scomma Sdash Speriod Sslash
3 S0 S1 S2 S3 S4 S5 S6 S7 S8 S9 Scolon Ssemicolon SLT SEQ SGT Squestion
4 SatSign ScapA ScapB ScapC ScapD ScapE ScapF ScapG ScapH ScapI ScapJ ScapK ScapL ScapM ScapN ScapO
5 ScapP ScapQ ScapR ScapS ScapT ScapU ScapV ScapW ScapX ScapY ScapZ Stheta Sbackslash SrBrack Scaret Sunderscore
6 Sbackquote SmallA SmallB SmallC SmallD SmallE SmallF SmallG SmallH SmallI SmallJ SmallK SmallL SmallM SmallN SmallO
7 SmallP SmallQ SmallR SmallS SmallT SmallU SmallV SmallW SmallX SmallY SmallZ SlBrace Sbar SrBrace Stilde SinvEQ
8 Ssub0 Ssub1 Ssub2 Ssub3 Ssub4 Ssub5 Ssub6 Ssub7 Ssub8 Ssub9 ScapAAcute ScapAGrave ScapACaret ScapADier SaAcute SaGrave
9 SaCaret SaDier ScapEGrave ScapEAcute ScapECaret ScapEDier SeAcute SeGrave SeCaret SeDier ScapIAcute ScapIGrave ScapICaret ScapIDier SiAcute SiGrave
A SiCaret SiDier ScapOAcute ScapOGrave ScapOCaret ScapODier SoAcute SoGrave SoCaret SoDier ScapUAcute ScapUGrave ScapUCaret ScapUDier SuAcute SuGrave
B SuCaret SuDier ScapCCed ScCed ScapNTilde SnTilde Saccent Sgrave Sdieresis SquesDown SexclamDown Salpha Sbeta Sgamma ScapDelta Sdelta
C Sepsilon SlBrack Slambda Smu Spi Srho ScapSigma Ssigma Stau Sphi ScapOmega SxMean SyMean SsupX Sellipsis Sleft
D Sblock Sper Shyphen Sarea Stemp Scube Senter SimagI Sphat Schi SstatF Slne SlistL SfinanN S2_r_paren SnarrowCapE
E SListLock Sscatter1 Sscatter2 Sxyline1 Sxyline2 Sboxplot1 Sboxplot2 Shist1 Shist2 SmodBox1 SmodBox2 Snormal1 Snormal2 STwoSpaces SThreeSpaces SFiveSpaces
F SSixSpaces ScurFull Sdollar SsqUp SsharpS SMPmixedFrac SMPfracSlash SMPentryBox

Introduction

The following chart depicts each character with its hexadecimal equivalent, name, and pixel width.

Individual Characters

SrecurN Hex: 01
Name: "Recursive n"
Width: 6px
SrecurU Hex: 02
Name: "Recursive u"
Width: 4px
SrecurV Hex: 03
Name: "Recursive v"
Width: 4px
SrecurW Hex: 04
Name: "Recursive w"
Width: 4px
Sconvert Hex: 05
Name: "Convert"
Width: 4px
SFourSpaces Hex: 06
Name: "Four Spaces"
Width: 4px
SsqDown Hex: 07
Name: "Square Down"
Width: 5px
Sintegral Hex: 08
Name: "Integral"
Width: 4px
Scross Hex: 09
Name: "Cross"
Width: 4px
SboxIcon Hex: 0A
Name: "Box Icon"
Width: 4px
ScrossIcon Hex: 0B
Name: "Cross Icon"
Width: 4px
SdotIcon Hex: 0C
Name: "Dot Icon"
Width: 4px
SsubT Hex: 0D
Name: "Subscript T"
Width: 4px
ScubeR Hex: 0E
Name: "Cube Root"
Width: 4px
ShexF Hex: 0F
Name: "Hexadecimal F"
Width: 5px
Sroot Hex: 10
Name: "Root"
Width: 4px
Sinverse Hex: 11
Name: "Inverse"
Width: 5px
Ssquare Hex: 12
Name: "Square"
Width: 4px
Sangle Hex: 13
Name: "Angle"
Width: 4px
Sdegree Hex: 14
Name: "Degree"
Width: 5px
Sradian Hex: 15
Name: "Radian"
Width: 5px
Stranspose Hex: 16
Name: "Transpose"
Width: 4px
SLE Hex: 17
Name: "Less Than or Equal To"
Width: 5px
SNE Hex: 18
Name: "Not Equal To"
Width: 6px
SGE Hex: 19
Name: "Greater Than or Equal To"
Width: 5px
Sneg Hex: 1A
Name: "Negation"
Width: 4px
Sexponent Hex: 1B
Name: "Exponent"
Width: 4px
Sstore Hex: 1C
Name: "Store"
Width: 5px
Sten Hex: 1D
Name: "Ten"
Width: 6px
SupArrow Hex: 1E
Name: "Up Arrow"
Width: 3px
SdownArrow Hex: 1F
Name: "Down Arrow"
Width: 3px
Sspace Hex: 20
Name: "Space"
Width: 1px
Sexclam Hex: 21
Name: "Exclamation Mark"
Width: 2px
Squote Hex: 22
Name: "Quotation Mark"
Width: 4px
Spound Hex: 23
Name: "Pound Sign"
Width: 6px
Sdollar Hex: 24
Name: "Dollar Sign"
Width: 6px
Spercent Hex: 25
Name: "Percent Sign"
Width: 4px
Sampersand Hex: 26
Name: "Ampersand"
Width: 5px
Sapostrophe Hex: 27
Name: "Apostrophe"
Width: 2px
SlParen Hex: 28
Name: "Left Parenthesis"
Width: 3px
SrParen Hex: 29
Name: "Right Parenthesis"
Width: 3px
Sasterisk Hex: 2A
Name: "Asterisk"
Width: 6px
SplusSign Hex: 2B
Name: "Plus Sign"
Width: 4px
Scomma Hex: 2C
Name: "Comma"
Width: 3px
Sdash Hex: 2D
Name: "Dash"
Width: 4px
Speriod Hex: 2E
Name: "Period"
Width: 2px
Sslash Hex: 2F
Name: "Slash"
Width: 4px
S0 Hex: 30
Name: "0"
Width: 4px
S1 Hex: 31
Name: "1"
Width: 4px
S2 Hex: 32
Name: "2"
Width: 4px
S3 Hex: 33
Name: "3"
Width: 4px
S4 Hex: 34
Name: "4"
Width: 4px
S5 Hex: 35
Name: "5"
Width: 4px
S6 Hex: 36
Name: "6"
Width: 4px
S7 Hex: 37
Name: "7"
Width: 4px
S8 Hex: 38
Name: "8"
Width: 4px
S9 Hex: 39
Name: "9"
Width: 4px
Scolon Hex: 3A
Name: "Colon"
Width: 2px
Ssemicolon Hex: 3B
Name: "Semicolon"
Width: 3px
SLT Hex: 3C
Name: "Less Than"
Width: 4px
SEQ Hex: 3D
Name: "Equal To"
Width: 4px
SGT Hex: 3E
Name: "Greater Than"
Width: 4px
Squestion Hex: 3F
Name: "Question Mark"
Width: 4px
SatSign Hex: 40
Name: "At Sign"
Width: 6px
ScapA Hex: 41
Name: "Capital A"
Width: 4px
ScapB Hex: 42
Name: "Capital B"
Width: 4px
ScapC Hex: 43
Name: "Capital C"
Width: 4px
ScapD Hex: 44
Name: "Capital D"
Width: 4px
ScapE Hex: 45
Name: "Capital E"
Width: 4px
ScapF Hex: 46
Name: "Capital F"
Width: 4px
ScapG Hex: 47
Name: "Capital G"
Width: 4px
ScapH Hex: 48
Name: "Capital H"
Width: 4px
ScapI Hex: 49
Name: "Capital I"
Width: 4px
ScapJ Hex: 4A
Name: "Capital J"
Width: 4px
ScapK Hex: 4B
Name: "Capital K"
Width: 4px
ScapL Hex: 4C
Name: "Capital L"
Width: 4px
ScapM Hex: 4D
Name: "Capital M"
Width: 4px
ScapN Hex: 4E
Name: "Capital N"
Width: 4px
ScapO Hex: 4F
Name: "Capital O"
Width: 4px
ScapP Hex: 50
Name: "Capital P"
Width: 4px
ScapQ Hex: 51
Name: "Capital Q"
Width: 4px
ScapR Hex: 52
Name: "Capital R"
Width: 4px
ScapS Hex: 53
Name: "Capital S"
Width: 4px
ScapT Hex: 54
Name: "Capital T"
Width: 4px
ScapU Hex: 55
Name: "Capital U"
Width: 4px
ScapV Hex: 56
Name: "Capital V"
Width: 4px
ScapW Hex: 57
Name: "Capital W"
Width: 4px
ScapX Hex: 58
Name: "Capital X"
Width: 4px
ScapY Hex: 59
Name: "Capital Y"
Width: 4px
ScapZ Hex: 5A
Name: "Capital Z"
Width: 4px
Stheta Hex: 5B
Name: "Theta"
Width: 4px
Sbackslash Hex: 5C
Name: "Backslash"
Width: 4px
SrBrack Hex: 5D
Name: "Right Bracket"
Width: 3px
Scaret Hex: 5E
Name: "Caret"
Width: 4px
Sunderscore Hex: 5F
Name: "Underscore"
Width: 4px
Sbackquote Hex: 60
Name: "Backquote"
Width: 3px
SmallA Hex: 61
Name: "Small A"
Width: 4px
SmallB Hex: 62
Name: "Small B"
Width: 4px
SmallC Hex: 63
Name: "Small C"
Width: 4px
SmallD Hex: 64
Name: "Small D"
Width: 4px
SmallE Hex: 65
Name: "Small E"
Width: 4px
SmallF Hex: 66
Name: "Small F"
Width: 3px
SmallG Hex: 67
Name: "Small G"
Width: 4px
SmallH Hex: 68
Name: "Small H"
Width: 4px
SmallI Hex: 69
Name: "Small I"
Width: 2px
SmallJ Hex: 6A
Name: "Small J"
Width: 4px
SmallK Hex: 6B
Name: "Small K"
Width: 4px
SmallL Hex: 6C
Name: "Small L"
Width: 3px
SmallM Hex: 6D
Name: "Small M"
Width: 6px
SmallN Hex: 6E
Name: "Small N"
Width: 4px
SmallO Hex: 6F
Name: "Small O"
Width: 4px
SmallP Hex: 70
Name: "Small P"
Width: 4px
SmallQ Hex: 71
Name: "Small Q"
Width: 4px
SmallR Hex: 72
Name: "Small R"
Width: 4px
SmallS Hex: 73
Name: "Small S"
Width: 3px
SmallT Hex: 74
Name: "Small T"
Width: 3px
SmallU Hex: 75
Name: "Small U"
Width: 4px
SmallV Hex: 76
Name: "Small V"
Width: 4px
SmallW Hex: 77
Name: "Small W"
Width: 6px
SmallX Hex: 78
Name: "Small X"
Width: 4px
SmallY Hex: 79
Name: "Small Y"
Width: 4px
SmallZ Hex: 7A
Name: "Small Z"
Width: 5px
SlBrace Hex: 7B
Name: "Left Brace"
Width: 4px
Sbar Hex: 7C
Name: "Vertical Bar"
Width: 2px
SrBrace Hex: 7D
Name: "Right Brace"
Width: 4px
Stilde Hex: 7E
Name: "Tilde"
Width: 5px
SinvEQ Hex: 7F
Name: "Inverse Equal To"
Width: 4px
Ssub0 Hex: 80
Name: "Subscript 0"
Width: 4px
Ssub1 Hex: 81
Name: "Subscript 1"
Width: 3px
Ssub2 Hex: 82
Name: "Subscript 2"
Width: 4px
Ssub3 Hex: 83
Name: "Subscript 3"
Width: 4px
Ssub4 Hex: 84
Name: "Subscript 4"
Width: 4px
Ssub5 Hex: 85
Name: "Subscript 5"
Width: 4px
Ssub6 Hex: 86
Name: "Subscript 6"
Width: 4px
Ssub7 Hex: 87
Name: "Subscript 7"
Width: 4px
Ssub8 Hex: 88
Name: "Subscript 8"
Width: 4px
Ssub9 Hex: 89
Name: "Subscript 9"
Width: 4px
ScapAAcute Hex: 8A
Name: "Capital A Acute"
Width: 5px
ScapAGrave Hex: 8B
Name: "Capital A Grave"
Width: 5px
ScapACaret Hex: 8C
Name: "Capital A Caret"
Width: 5px
ScapADier Hex: 8D
Name: "Capital A Diaeresis"
Width: 5px
SaAcute Hex: 8E
Name: "Small A Acute"
Width: 5px
SaGrave Hex: 8F
Name: "Small A Grave"
Width: 5px
SaCaret Hex: 90
Name: "Small A Caret"
Width: 5px
SaDier Hex: 91
Name: "Small A Diaeresis"
Width: 5px
ScapEGrave Hex: 92
Name: "Capital E Grave"
Width: 5px
ScapEAcute Hex: 93
Name: "Capital E Acute"
Width: 5px
ScapECaret Hex: 94
Name: "Capital E Caret"
Width: 4px
ScapEDier Hex: 95
Name: "Capital E Diaeresis"
Width: 4px
SeAcute Hex: 96
Name: "Small E Acute"
Width: 4px
SeGrave Hex: 97
Name: "Small E Grave"
Width: 4px
SeCaret Hex: 98
Name: "Small E Caret"
Width: 4px
SeDier Hex: 99
Name: "Small E Diaeresis"
Width: 4px
ScapIAcute Hex: 9A
Name: "Capital I Acute"
Width: 4px
ScapIGrave Hex: 9B
Name: "Capital I Grave"
Width: 4px
ScapICaret Hex: 9C
Name: "Capital I Caret"
Width: 4px
ScapIDier Hex: 9D
Name: "Capital I Diaeresis"
Width: 4px
SiAcute Hex: 9E
Name: "Small I Acute"
Width: 4px
SiGrave Hex: 9F
Name: "Small I Grave"
Width: 4px
SiCaret Hex: A0
Name: "Small I Caret"
Width: 4px
SiDier Hex: A1
Name: "Small I Diaeresis"
Width: 4px
ScapOAcute Hex: A2
Name: "Capital O Acute"
Width: 6px
ScapOGrave Hex: A3
Name: "Capital O Grave"
Width: 6px
ScapOCaret Hex: A4
Name: "Capital O Caret"
Width: 6px
ScapODier Hex: A5
Name: "Capital O Diaeresis"
Width: 6px
SoAcute Hex: A6
Name: "Small O Acute"
Width: 6px
SoGrave Hex: A7
Name: "Small O Grave"
Width: 6px
SoCaret Hex: A8
Name: "Small O Caret"
Width: 6px
SoDier Hex: A9
Name: "Small O Diaeresis"
Width: 6px
ScapUAcute Hex: AA
Name: "Capital U Acute"
Width: 4px
ScapUGrave Hex: AB
Name: "Capital U Grave"
Width: 4px
ScapUCaret Hex: AC
Name: "Capital U Caret"
Width: 4px
ScapUDier Hex: AD
Name: "Capital U Diaeresis"
Width: 4px
SuAcute Hex: AE
Name: "Small U Acute"
Width: 5px
SuGrave Hex: AF
Name: "Small U Grave"
Width: 5px
SuCaret Hex: B0
Name: "Small U Caret"
Width: 5px
SuDier Hex: B1
Name: "Small U Diaeresis"
Width: 5px
ScapCCed Hex: B2
Name: "Capital C Cedilla"
Width: 4px
ScCed Hex: B3
Name: "Small C Cedilla"
Width: 4px
ScapNTilde Hex: B4
Name: "Capital N Tilde"
Width: 5px
SnTilde Hex: B5
Name: "Small N Tilde"
Width: 5px
Saccent Hex: B6
Name: "Accent"
Width: 3px
Sgrave Hex: B7
Name: "Grave"
Width: 3px
Sdieresis Hex: B8
Name: "Diaeresis"
Width: 4px
SquesDown Hex: B9
Name: "Inverted Question Mark"
Width: 4px
SexclamDown Hex: BA
Name: "Inverted Exclamation Mark"
Width: 2px
Salpha Hex: BB
Name: "Small Alpha"
Width: 5px
Sbeta Hex: BC
Name: "Small Beta"
Width: 4px
Sgamma Hex: BD
Name: "Small Gamma"
Width: 5px
ScapDelta Hex: BE
Name: "Capital Delta"
Width: 6px
Sdelta Hex: BF
Name: "Small Delta"
Width: 4px
Sepsilon Hex: C0
Name: "Small Epsilon"
Width: 4px
SlBrack Hex: C1
Name: "Left Bracket"
Width: 3px
Slambda Hex: C2
Name: "Small Lambda"
Width: 4px
Smu Hex: C3
Name: "Small Mu"
Width: 5px
Spi Hex: C4
Name: "Small Pi"
Width: 6px
Srho Hex: C5
Name: "Small Rho"
Width: 5px
ScapSigma Hex: C6
Name: "Capital Sigma"
Width: 5px
Ssigma Hex: C7
Name: "Small Sigma"
Width: 5px
Stau Hex: C8
Name: "Small Tau"
Width: 5px
Sphi Hex: C9
Name: "Small Phi"
Width: 6px
ScapOmega Hex: CA
Name: "Capital Omega"
Width: 6px
SxMean Hex: CB
Name: "X Mean"
Width: 4px
SyMean Hex: CC
Name: "Y Mean"
Width: 4px
SsupX Hex: CD
Name: "Superscript X"
Width: 4px
Sellipsis Hex: CE
Name: "Ellipsis"
Width: 3px
Sleft Hex: CF
Name: "Left Pointing Triangle"
Width: 4px
Sblock Hex: D0
Name: "Block"
Width: 3px
Sper Hex: D1
Name: "Per"
Width: 4px
Shyphen Hex: D2
Name: "Hyphen"
Width: 3px
Sarea Hex: D3
Name: "Area"
Width: 4px
Stemp Hex: D4
Name: "Temperature"
Width: 4px
Scube Hex: D5
Name: "Cube"
Width: 4px
Senter Hex: D6
Name: "Enter"
Width: n/a
SimagI Hex: D7
Name: "Imaginary I"
Width: 4px
Sphat Hex: D8
Name: "P Hat"
Width: 4px
Schi Hex: D9
Name: "Small Chi"
Width: 4px
SstatF Hex: DA
Name: "Stat F"
Width: 4px
Slne Hex: DB
Name: "Natural Logarithm E"
Width: 4px
SlistL Hex: DC
Name: "List Capital L"
Width: 3px
SfinanN Hex: DD
Name: "Finance Capital N"
Width: 3px
S2_r_paren Hex: DE
Name: "Two Right Parentheses"
Width: 4px
SnarrowCapE Hex: DF
Name: "Narrow Capital E"
Width: 3px
SListLock Hex: E0
Name: "List Lock"
Width: 3px
Sscatter1 Hex: E1
Name: "Scatter 1"
Width: 6px
Sscatter2 Hex: E2
Name: "Scatter 2"
Width: 5px
Sxyline1 Hex: E3
Name: "xyLine 1"
Width: 6px
Sxyline2 Hex: E4
Name: "xyLine 2"
Width: 5px
Sboxplot1 Hex: E5
Name: "Boxplot 1"
Width: 6px
Sboxplot2 Hex: E6
Name: "Boxplot 2"
Width: 5px
Shist1 Hex: E7
Name: "Histogram 1"
Width: 6px
Shist2 Hex: E8
Name: "Histogram 2"
Width: 5px
SmodBox1 Hex: E9
Name: "ModBoxplot 1"
Width: 6px
SmodBox2 Hex: EA
Name: "ModBoxplot 2"
Width: 5px
Snormal1 Hex: EB
Name: "NormProbPlot 1"
Width: 6px
Snormal2 Hex: EC
Name: "NormProbPlot 2"
Width: 5px
STwoSpaces Hex: ED
Name: "Two Spaces"
Width: 2px
SThreeSpaces Hex: EE
Name: "Three Spaces"
Width: 3px
SFiveSpaces Hex: EF
Name: "Five Spaces"
Width: 5px
SSixSpaces Hex: F0
Name: "Six Spaces"
Width: 6px
ScurFull Hex: F1
Name: "Cursor Full"
Width: 4px
Sdollar Hex: F2
Name: "Dollar Sign"
Width: 6px
SsqUp Hex: F3
Name: "Square Up"
Width: 5px
SsharpS Hex: F4
Name: "Sharp S"
Width: 5px
SMPmixedFrac Hex: F5
Name: "MathPrint Mixed Fraction Separator"
Width: 4px
SMPfracSlash Hex: F6
Name: "MathPrint Fraction Slash"
Width: 4px
SMPentryBox Hex: F7
Name: "MathPrint Entry Box"
Width: 6px
Name: Little Man Computer Emulator LMC v1.0
Author: Rick Skrbina
Download: LMC Emulator.zip
Compatibility: Parent page not set
File Size: 1,144 Bytes
The Little Man Computer was designed to teach students how computers work and about assembly language. This is a Little Man Computer emulator for your TI 83. It runs pure LMC machine code with 100% accuracy and full speed. The only difference form this emulator from the real LMC is that this emulator only has 99 mailboxes instead of 100. This is a great program for you if you ever want to learn assembly language.

author: 'TI-Basic Developer'
description: 'You have to chase down the randomly moving target.'
arcade: '1'
graphics: '0'
platform: '0'
puzzle: '0'
rpg: '0'
strategy: '0'
sports: '0'
casino: '0'
board: '0'
utility: '0'
misc: '0'
image: /home/no_image_2.png
download: chase.zip
size: '210'
unit: '1'

Name: Maze Walkthrough
Author: TI-Basic Developer
Download: MazeWalkthrough.zip
Compatibility: Parent page not set
File Size: 244 Bytes
You have to make your way through the maze without touching any of the walls.
Name: Simon Says
Author: TI-Basic Developer
Download: SimonSays.zip
Compatibility: Parent page not set
File Size: 214 Bytes
You must repeat a pattern which gets longer and longer.
Name: Fly The Copter
Author: Weregoose
Download: FlyTheCopter.zip
Compatibility: Parent page not set
File Size: 356 Bytes
You have to navigate a scrolling tunnel for as long as possible.
Name: Hop Over
Author: Weregoose
Download: HopOver.zip
Compatibility: Parent page not set
File Size: 400 Bytes
You have to move the pieces around until you get the four squares on the left and the four crosshairs on the right.
Name: Demented Snake
Author: TI-Basic Developer
Download: DementedSnake.zip
Compatibility: Parent page not set
File Size: 289 Bytes
Just like snake, except you need to constantly change directions to keep the snake moving fast.
Name: Rock Paper Scissors
Author: TI-Basic Developer
Download: RockPaperScissors.zip
Compatibility: Parent page not set
File Size: 296 Bytes
You have three different hand gestures to choose from, but can you choose the best hand…
Name: Hangman
Author: TI-Basic Developer
Download: Hangman.zip
Compatibility: Parent page not set
File Size: 444 Bytes
Alternate turns trying to guess a word by selecting the letters that make up the word until the word is correctly guessed or you run out of chances.

author: 'TI-Basic Developer'
description: 'A simple "card" game where you flip over two cards each turn to try to get a matching pair.'
arcade: '0'
graphics: '0'
platform: '0'
puzzle: '1'
rpg: '0'
strategy: '0'
sports: '0'
casino: '0'
board: '0'
utility: '0'
misc: '0'
image: /home/no_image_2.png
download: memory.zip
size: '389'
unit: '1'

Name: Snake
Author: TI-Basic Developer
Download: Snake.zip
Compatibility: Parent page not set
File Size: 268 Bytes
Go around eating food, and the snake grows longer and longer with each piece of food.
Name: Avalanche
Author: TI-Basic Developer
Download: Avalanche.zip
Compatibility: Parent page not set
File Size: 301 Bytes
Avoid the falling spikes by moving to the left or right, trying to see how long you can hold out for.
Name: Tic Tac To
Author: TI-Basic Developer
Download: TicTacTo.zip
Compatibility: Parent page not set
File Size: 277 Bytes
Alternate turns placing pieces on the 3x3 game board until somebody gets 3-in-a-row or all nine spots on the game board are filled.
Name: Darts
Author: TI-Basic Developer
Download: Darts.zip
Compatibility: Parent page not set
File Size: 298 Bytes
Hit the target with your dart, while avoiding the obstacles in your way.
Name: Guess the Number
Author: TI-Basic Developer
Download: NumberGuess.zip
Compatibility: Parent page not set
File Size: 215 Bytes
Try to guess the number, and see how many tries it takes you.
Name: Mine Field
Author: TI-Basic Developer
Download: Minefield.zip
Compatibility: Parent page not set
File Size: 239 Bytes
Like the classic game minesweeper, the goal is to avoid hitting the mines.
Name: Pong
Author: TI-Basic Developer
Download: Pong.zip
Compatibility: Parent page not set
File Size: 176 Bytes
You have to keep the ball in play by bouncing it back and forth against the walls, without letting it get by your paddle.

The term "graph" is ambiguous and may refer to:

  • Graph Screen, the screen where equations are graphed and graphics are displayed.
  • Graphstyle(, sets the graphing style of a graphing equation in the current mode.
  • Graph Mode, the mode the calculator uses when graphing equations.

If an internal link led you here, you may wish to change the link to point directly to the intended article.

Routine Summary

Makes text appear letter by letter

Inputs

Str1 - Text to be displayed.
A,B - Row and colum to display text.

Variables Used

A, B, T, Str1

Calculator Compatibility

All TI calculators

:For(T,1,length(Str1
:Text(A,B,sub(Str1,1,T
:rand(5
:End

We use a For( loop over the length of the string to go through the string letter by letter. In order to make the spacing come out right, instead of figuring out the right coordinate to display each character at, we display the first T characters of the string starting from the beginning. The rand(5) provides a split-second delay to achieve the typewriter effect.

For multiple lines with the typewriter effect, you can combine this routine with the one to wordwrap text.

Error Conditions

  • ERR:DOMAIN is thrown if the string doesn't fit entirely on the screen.

Related Routines

Recent Forum Posts

Here's a start to some responsive CSS. @import...
(by Battlesquid 23 May 2018 05:33, posts: 10)
I see, that's fair…
(by LAX18 22 May 2018 15:11, posts: 8)
A few things: Not many people don't have access to YouTube If they don't have access to YouTube,...
(by Trenly 22 May 2018 14:49, posts: 10)

Recent Forum Threads

(Started 21 May 2018 20:42, Posts: 3)
(Started 21 May 2018 18:57, Posts: 2)
(Started 21 May 2018 18:27, Posts: 2)
(Started 20 May 2018 23:28, Posts: 10)
(Started 18 May 2018 23:35, Posts: 8)
(Started 18 May 2018 16:15, Posts: 2)

We are excited that you have chosen to visit our site, and firmly believe that you will not only leave as a better TI-Basic programmer, but that you will come to see the site as your TI-Basic home!

You will find that this community was designed to be a friendly and welcoming environment, and we are dedicated to providing information and discussion to anyone interested in TI-Basic.

Whether you are just starting out in programming or you are already an accomplished TI-Basic programmer, you are welcome to join our community.

Site Features

The site offers a rich assortment of features, and we encourage you to explore it at your own pace:

Where to Begin?

When you feel comfortable, we invite you to get involved on the site. Registration is a simple two-step process and involves creating a Wikidot account and then going to the join page to join the site. It is quick and painless, and should take no more than a couple minutes. We then encourage you to introduce yourself to the community so that we can get to know you better. We also suggest reading the rules, as well as the how-to page, as both contain information you will want to know.

The forums are where much of the community activity takes place, so you will want to regularly visit to see what's new. They are conveniently separated into different categories based on the types of discussions they contain, including site discussion, general discussion, programming & design, and projects & contests.

You will also want to enable the watching feature by clicking the "start watching" link in the bottom page options toolbar. This allows you to follow changes on the whole site, just the forum, or a particular page, and you will be notified via email whenever someone alters it or adds a comment to it. Watching can be enabled/disabled in the activities settings of your Wikidot account.

You can navigate the site by using the links in the navigation bar at the top of the page, or by going to the sitemap for a hierarchical view. The home link is accessible on the other pages by clicking the respective link in the top navigation, and you can search the site by using the search box at the top right of the page. You will find the search box to be an invaluable tool to locate information from pages and old posts in the forums.

Contact Information

If you wish to contact the administrators for any reason, you have a few different routes you can take:

  • Create a Wikidot account and send a private message (PM) to the administrator of your choice. Just click on the arrow at the top right corner and select "private messages".
  • Find the email address of each administrator on their profile page and send them an email with your question. Of course, this only works if the administrator lists their email address.
  • Start a new topic in the discussion forums. This method works well if you don't care which administrator responds, but you should know that everyone can see this forum. If you have a personal question you want to ask, sending a PM is the way to go.

We will try to respond in a timely manner, hopefully in a day or two. Please just be patient.


We hope that you enjoy using the site and stop by often.

Thanks for visiting!

The TI-Basic Developer Community

author: Mapar007
description: "Data storage system with personal sheets and bookmark codes.\n\nThe second version of Mnemon."
arcade: '0'
graphics: '0'
platform: '0'
puzzle: '0'
rpg: '0'
strategy: '0'
sports: '0'
casino: '0'
board: '0'
utility: '1'
misc: '0'
image: '/archives:mnemon2/mnemon2.jpg'
download: mnemon_2.5.zip
size: '2453'
unit: '1'

The abbreviation "asm" is ambiguous and may refer to:

  • Asm(, the command used for running a shell-independent assembly program.
  • Assembly, the other programming language available on the TI graphing calculators.

If an internal link led you here, you may wish to change the link to point directly to the intended article.

The ListPages module does not work recursively.

Horizontal Sprites

Explanation

In order to create a text sprite, one must have a series of characters and each character returns a certain number of pixels in certain arrangement on the graphscreen. Each character, when displayed on the graphscreen will return certain pixels in its first column of text. For example, if one displayed the letter "J" to the graphscreen it would look like this: (0 = empty pixel, 1 = filled pixel)

001
001
001
101
111

The first column of text is therefore "00011." The value, 00011b, (in binary) is equivalent to the decimal value 3. Each character, when displayed on the graphscreen will such a number associated with it. Therefore it is easy to organize all the possible text sprites numerically.

You can create rows of text spites this way. You could then stack these rows up from bottom to top to fill large portions of the screen. An important thing to remember though, is that vertical text sprites are much faster for larger images. They can fill the entire screen in just 4 seconds on an 84!

Chart

This chart contains the best characters to use for each pixel combination when drawing a text sprite:

  1. Each is at most three pixels wide (not counting the 1-pixel margin to the left of each character).
  2. When possible, they are 1-byte characters, or if not, at least commonly accessible.
Char. Binary Decimal Char. Binary Decimal
space 00000b 0 ? 10000b 16
. 00001b 1 ] 10001b 17
0Bh_LcrossIcon.gif mark 00010b 2 2 10010b 18
J 00011b 3 2 10011b 19
+ 00100b 4 x 10100b 20
í 00101b 5 $\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{\mathrm{x}}$ 10101b 21
e 00110b 6 û 10110b 22
0Ah_LboxIcon.gif mark 00111b 7 $\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} i$ 10111b 23
^ 01000b 8 Y 11000b 24
1 01001b 9 Î 11001b 25
: 01010b 10 $\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \chi$ 11010b 26
none 01011b 11 X 11011b 27
º 01100b 12 ' 11100b 28
s 01101b 13 ! 11101b 29
( 01110b 14 Q 11110b 30
u 01111b 15 [ 11111b 31

Vertical Sprites

Differences with horizontal sprites

The main difference for a vertical sprite is that you need only one text( command to fill an entire horizontal line. It has a noticeable advantage on horizontal sprites when sprites are larger. It is not only faster but you are not limited to a 5x5 sprite or a 7x7 sprite. Also, you don't use a picture variable which can be more convenient in some situations. You don't need to group Pics and your program in order to send it to someone.
In order to draw a sprite, you must draw from bottom to top in order to not erase what is already written. The main disadvantage is that only ∟ , N and … don't end with a 0. But it really doesn't matter, because you can make any vertical sprite using only the ., [, and the ∟. In conclusion, if you need to draw large sprites or even to fill the graphscreen, you should use vertical sprites, otherwise horizontal sprites are for you.

:Text(9,1,"1
:Text(8,1,"Δ
:Text(7,1,"Ω
:Text(6,1,"Δ
:Text(5,1," 1
:Text(4,1,"     //5 spaces

Chart

This chart contains characters from 1 to 6 pixels wide. A 0 represents an empty pixel while a 1 is for a black pixel. If you need a character larger than 6 pixels wide, you can search in Weregoose database here.

Char. Binary Char. Binary Char. Binary Char. Binary
space 0 - 0000 07h_LsqDown.gif 00100 * 001000
: 00 4 0010 σ 01000 010000
. 10 0 0100 û 01010 w 010100
` 000 { 0110 É 01110 @ 011100
( 010 F 1000 μ 10000 m 100010
) 100 A 1010 ñ 10010 n 100100
N 101 } 1100 ß 10100 10 101110
[ 110 1 1110 È 11100 Ω 110110
111 ° 00000 z 11110 $ 111100
Δ 111110

Also see

Text Sprite Finder - this program is a compact version of what is on this page, this page simply explains how this program fundamentally works.
Vertical Sprites Bottom Row - to have a complete database with the bottom row of all TI-83/84/+/SE characters.
Graphics - for information on using text sprites.
Binary and Hexidecimal - to understand how to read the binary format.
TI-83 Plus Large Font - for clarification on which characters are being referred to.
CHARS.8xp - A program that contains many otherwise unobtainable characters.
Text Sprite Generator - A drawing program that outputs the text sprite code to display the sprite.

If you have ever played any of the snake, mofrog, nibbles, etc. games, then this game should be familiar to you. The basic premise is to go around eating food and the snake grows longer with each piece of food. However, this snake game has an additional element to it: you need to constantly change directions to keep the snake moving fast. Like with the other games, try out the game and try to understand and think through the code.

Table of Contents

The Code

:26-2int(2rand→K
:{4→L1:Ans→L2:1→I
:ClrHome
:For(J,1,E2
:L1(1→L1(J
:L2(1→L2(J
:Repeat max(S≠L1 and Ans≠L2
:randInt(1,8→S
:randInt(1,16→T
:End
:Output(S,Ans,"*
:Repeat T=Ans and S=L1(I
:getKey
:If Ans=45:Goto Q
:If Ans=34 or 2>abs(Ans-25:Ans→K
:I+1-J(I=J→I
:Output(L1(Ans),L2(Ans),"  // 1 space
:(K=34)-(K=25)+L1(Ans-(Ans>1
:Ans+8(not(Ans)-(Ans=9→L1(I
:(K=26)-(K=24)+L2(I-(I>1
:Ans+16(not(Ans)-(Ans=17→L2(I
:Output(L1(I),Ans,"O
:End:End
:Lbl Q
:ClrHome:J

The Download

In case you want to try the program on your calculator, you can download the program in .8xp format.

Whee! You got through the first part of the starter kit! Now, we come to the second part, which will get into the finer points of the homescreen and data types.
We will start off the second part of the kit by discussing more of the homescreen. Let's begin, shall we?

Letting the User See Something

Back in the first part, you only learned of one command that can display information, the Disp command. We will learn two more commands that deal with output, starting with the ClrHome command.

ClrHome

The ClrHome command clears the homescreen, giving you an empty space to work with. No arguments are needed, just select it from the I/O menu of the PRGM button (only accessible this way while editing).

Two Notes

  1. Output( will write over anything on the homescreen
  2. Disp, Input, and Prompt will not recognize Output( commands, so if you have some text printed at 1,1 and then use Input, you will write over the Output(

Output

The Output( command lets you print text, just like the Disp command. There are two differences, though: You can choose where to start the text, and strings that go off the end of the screen will wrap around to the next line!
To use it, you need three arguments: the row where the first character appears, the column, and the text.
You use it like so:

:Output(8,1,"PRESS ENTER")

This text starts at the bottom-left corner of the screen, and prints PRESS ENTER.
The most useful application for Output( is to dynamically update the home screen. If you had money in the top left corner and life in the bottom left for a game, using Disp to update those would be a pain. You would have the un-updated text blink, because you had to ClrHome first. Output allows you to avoid the flicker.

Making the Program Smart

In the past, you only knew of the Input command for input. Now we will cover two more input methods, the first being Prompt.

Prompt

Prompt is a much more primitive command than Input, but it gets the job done. It only needs one argument: the variable. You can add more variables to one Prompt statement, as long as they are separated by commas. Here is a basic use:

Prompt A

The code will show A=?, which means, "What do you want A to equal?". Prompt has limitations, and quality programs are unlikely to use it because the A=? thing doesn't look very professional.
The limitations are outlined below:
  • Cryptic - Prompt doesn't allow custom text to be displayed, unlike Input. The casual calculator user can be intimated by the cryptic look that is forced.
  • No Exception - If you want someone to enter a string using Prompt, the user must put quotation marks around the string or risk error. Input doesn't care.

Final Notes

These are the last of the commands that can directly influence the home screen. The furthest from direct influence is getKey, which you will discover in detail in the next lesson. More on the commands you just learned can be found on their respective pages. Try searching for them in the upper right hand corner of the site!
Hopefully you can use the homescreen commands well. Next up we explore the hidden elements of input: data types, and the getKey command.

<< Sample Program: Guessing Game Table of Contents Using getKey >>
Name: Vortex
Author: Builderboy2005
Download: Vortex.zip
Compatibility: Parent page not set
File Size: 3,964 Bytes
Vortex is a fun, challenging, turn-based multiplayer strategy game. The object of the game is to kill your opponent. You can go around collecting boxes of money and use them to buy upgrades, items, and weapons. The game also features a random level generator. Fully MirageOS compatible.

Matrices are a step up from lists. Lists are a string of elements, like {5,4,3,2,1,0}. A matrix, on the other hand, is a list of lists, like [[5,5,5],[4,4,4],[3,3,3],[2,2,2]]. Below, we will start learning how to handle this more complex data type.

Setting up Matrices

Unfortunately, unlike lists, there is no SetUpEditor command to make it easy for matrices. Fortunately, though, matrices [A] through [J] always exist, unless otherwise removed. This gets rid of the need to dim( first. You do need to be careful with UnArchive. To ask if the user has already run the program, you could use a routine such as the following:

:Menu("CONTINUE?","YES",Y,"NO",N)
:Lbl Y
:UnArchive [J]
:Lbl N
:{2,3}→dim([J])

What does that last line of code do? Well, this is just like setting the size of lists in the last lesson. The only difference is that we need to have two numbers that are separated by a comma and surrounded by curly braces. The last line of code above says to give matrix [J] 2 rows and 3 columns. If you prefer to think of matrices as lists of lists, you can say that the last line of code says, "Provide 2 lists, each with 3 elements."

Using Matrices

Writing

It is really simple to store an element into a matrix. To store the number 5 into row 1 and column 2 of our matrix [J], we use this line:

:5→[J](1,2)

Simple, right? What if you want to store the powers of 2 from element (1,1) to (2,3)? We have to use this code:

:{2,3}→dim([J])
:0→P
:For(R,1,2)
:For(C,1,3)
:P+1→P
:2^P→[J](R,C)
:End
:End

Notice how it is a lot more complicated than the version with the list. This is because we first start the For( loop for both rows of our matrix, and then within that we start the For( loop for every column of the current row.

Reading

Let's make this simple. To store a matrix element to a variable, use this line of code:

:[J](1,2)→A

This stores element (1,2) of [J] into the real variable A.
To display it, use this line:

:Disp [J](1,2)

Now, let's modify our program to show some results.

:ClrHome
:{2,3}→dim([J])
:0→P
:For(R,1,2)
:For(C,1,3)
:P+1→P
:2^P→[J](R,C)
:Disp [J](R,C)
:End
:End

We've added a ClrHome command to the beginning, and a Disp command above the two Ends. If you do it right, your output should be:

2
4
8
16
32
64
Done

Cleaning Up

Fortunately, you just need to use the Archive command for a matrix to be archived.

Final Notes

Now, you see how much more powerful a matrix is, when coming from a list. Matrices are usually used to store map data and such. Still, the bigger step up is the string data type. This is the most powerful variable type, and you will learn about it next.

<< Data Types (lists) Table of Contents Data Types (strings) >>
Name: Portal
Author: Builderboy
Download: Portal.zip
Compatibility: Parent page not set
File Size: 9,405 Bytes
In Portal, you are a test subject at The Aperture Science Enrichment Program and are testing The recent invention of the Portal Gun! Yay! It allows you to shoot portals and move between them. Those who have played the official version will remember GlaDos… And she's back in the calculator version! GlaDOS is your narrator and guide and is the one that will monitor all your tests. But when the tests are over… Watch out! the game isn't over yet…
Name: Minigame Party
Author: 7thAce
Download: Minigame-Party.zip
Compatibility: Parent page not set
File Size: 7,856 Bytes
This is a game package. There are 4 games in there now, and 4 more will be coming. Press 2nd to play them all in order. Just read the readme :)
Name: Mnemon
Author: Mapar007
Download: Mnemon.zip
Compatibility: Parent page not set
File Size: 1,073 Bytes

This is a program to create data sheets and read them. You must input a random code of 6 letters/numbers which form your personal ID. It will mace secure that nobody else can read your data sheets on their calculator!

(note:do not pick MNEMON as a code, unless you want everyone to be able to read your files!)

Name: Move
Author: Mapar007
Download: Move.zip
Compatibility: Parent page not set
File Size: 2,674 Bytes
Game in which you must collect O's with an X without stepping the *'s
Name: Bunny Gotchi
Author: James Kanjo
Download: BunnyGotchi_1-7.zip
Compatibility: Parent page not set
File Size: 6,637 Bytes

Bunny Gotchi is a virtual pet (a bunny rabbit) on your calculator. Bunny Gotchi is one of the few "Tamagotchi" programs available to the TI-83plus, and fewer still containing animations. It will challenge your efforts to keep it alive, healthy and happy!

Version 1.7 is architecturally identical to version 1.6, but is 483 bytes smaller.

[[include inc:tablet
|name=
|author=
|size=
|description=

|picture=
|downloadUrl=
|downloadName=
]]

|name=

Type in the name of the program.

|author=

Type in the name of the Author. Alternatively, you can include a URL link to the author's page by typing in: [URL Author's Name]

|size=

Type in the size of the program as it appears on the calculator. Make sure to include any subprograms, variables, pictures, or anything else that is included with the program.

  • If the program size is under 20,000 bytes, use bytes: 17,235 Bytes
  • If the program size is over 20,000 bytes, use KB: 23KB

|description=

Enter a brief description about the program.

|picture=

Type in: FULL-URL

If nothing is entered, a default image will appear instead.

|downloadUrl=

Type in the full URL of the program file.

|downloadName=

Type in the name that you want to appear for the program file's download: File.zip.

Name: No name given
Author: No author given
Download: Download Unavailable
Compatibility: Parent page not set
File Size: No size given
No description given

author: 'Robert Moy (Harrierfalcon)'
description: 'Metroid Pi is a pure TI-Basic version of the classic Metroid game, with the game following the standard storyline of making your way through several increasingly difficult areas, while battling enemies, bosses, and getting powerups that allow you to beat the next area in the game.'
arcade: '0'
graphics: '0'
platform: '1'
puzzle: '0'
rpg: '1'
strategy: '0'
sports: '0'
casino: '0'
board: '0'
utility: '0'
misc: '0'
image: /metroid-pi/metroidpi.gif
download: metroidpi.zip
size: '17016'
unit: '1'

Name: {$name}
Author: {$author}
Download: [{$downloadUrl} {$downloadName}]
Compatibility: {$compatibility}
File Size: {$size}
{$description}
Name: Donut Quest
Author: Mikhail Lavrov (DarkerLine)
Download: DonutQuest.zip
Compatibility: Parent page not set
File Size: 10,154 Bytes
Donut Quest is a TI-Basic game of revolutionary quality. It uses no libraries of any kind, in fact, you don't need anything other than the game program to play it. On each of eight levels, you must get to (and eat) all the donuts, then leave through an exit (unless given other instructions).

Binary, hexadecimal, and octal refer to different number systems. The one that we typically use is called decimal. These number systems refer to the number of symbols used to represent numbers. In the decimal system, we use ten different symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. With these ten symbols, we can represent any quantity. For example, if we see a 2, then we know that there is two of something. For example, this sentence has 2 periods on the end..

When we run out of symbols, we go to the next digit placement. To represent one higher than 9, we use 10 meaning one unit of ten and zero units of one. This may seem elementary, but it is crucial to understand our default number system if you want to understand other number systems.

For example, when we consider a binary system which only uses two symbols, 0 and 1, when we run out of symbols, we need to go to the next digit placement. So, we would count in binary 0, 1, 10, 11, 100, 101, and so on.

This article will discuss the binary, hexadecimal, and octal number systems in more detail and explain their uses.

How a Number System Works

Number systems are used to describe the quantity of something or represent certain information. Because of this, I can say that the word "calculator" contains ten letters. Our number system, the decimal system, uses ten symbols. Therefore, decimal is said to be Base Ten. By describing systems with bases, we can gain an understanding of how that particular system works.

When we count in Base Ten, we count starting with zero and going up to nine in order.

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, …

Once we reach the last symbol, we create a new placement in front of the first and count that up.

8, 9, 10, 11, 12, … , 19, 20, …


This continues when we run out of symbols for that placement. So, after 99, we go to 100.

The placement of a symbol indicates how much it is worth. Each additional placement is an additional power of 10. Consider the number of 2853. We know this number is quite large, for example, if it pertains to the number of apples in a basket. That's a lot of apples. How do we know it is large? We look at the number of digits.

Each additional placement is an additional power of 10, as stated above. Consider this chart.
103 102 101 100
digit digit digit digit
*1000 *100 *10 *1

Each additional digit represents a higher and higher quantity. This is applicable for Base 10 as well as to other bases. Knowing this will help you understand the other bases better.

Binary

Binary is another way of saying Base Two. So, in a binary number system, there are only two symbols used to represent numbers: 0 and 1. When we count up from zero in binary, we run out of symbols much more frequently.

0, 1, …

From here, there are no more symbols. We do not go to 2 because in binary, a 2 doesn't exist. Instead, we use 10. In a binary system, 10 is equal to 2 in decimal.

We can count further.

Binary 0 1 10 11 100 101 110 111 1000 1001 1010
Decimal 0 1 2 3 4 5 6 7 8 9 10
Just like in decimal, we know that the more digits there are, the larger the number. However, in binary, we use powers of two. In the binary number 1001101, we can create a chart to find out what this really means.
26 25 24 23 22 21 20
1 0 0 1 1 0 1
64+0+0+8+4+0+1
77

Since this is base two, however, the numbers don't get quite as large as it does in decimal. Even still, a binary number with 10 digits would be larger than 1000 in decimal.


The binary system is useful in computer science and electrical engineering. Transistors operate from the binary system, and transistors are found in practically all electronic devices. A 0 means no current, and a 1 means to allow current. With various transistors turning on and off, signals and electricity is sent to do various things such as making a call or putting these letters on the screen.

Computers and electronics work with bytes or eight digit binary numbers. Each byte has encoded information that a computer is able to understand. Many bytes are stringed together to form digital data that can be stored for use later.

Octal

Octal is another number system with less symbols to use than our conventional number system. Octal is fancy for Base Eight meaning eight symbols are used to represent all the quantities. They are 0, 1, 2, 3, 4, 5, 6, and 7. When we count up one from the 7, we need a new placement to represent what we call 8 since an 8 doesn't exist in Octal. So, after 7 is 10.

Octal 0 1 2 3 4 5 6 7 10 11 12… 17 20… 30… 77 100
Decimal 0 1 2 3 4 5 6 7 8 9 10… 15 16… 24… 63 64

Just like how we used powers of ten in decimal and powers of two in binary, to determine the value of a number we will use powers of 8 since this is Base Eight. Consider the number 3623 in base eight.

83 82 81 80
3 6 2 3
1536+384+16+3
1939

Each additional placement to the left has more value than it did in binary. The third digit from the right in binary only represented 23-1, which is 4. In octal, that is 83-1 which is 64.

Hexadecimal

The hexadecimal system is Base Sixteen. As its base implies, this number system uses sixteen symbols to represent numbers. Unlike binary and octal, hexadecimal has six additional symbols that it uses beyond the conventional ones found in decimal. But what comes after 9? 10 is not a single digit but two… Fortunately, the convention is that once additional symbols are needed beyond the normal ten, letters are to be used. So, in hexadecimal, the total list of symbols to use is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. In a digital display, the numbers B and D are lowercase.

When counting in hexadecimal, you count 0, 1, 2, and so on. However, when you reach 9, you go directly to A. Then, you count B, C, D, E, and F. But what is next? We are out of symbols! When we run out of symbols, we create a new digit placement and move on. So after F is 10. You count further until you reach 19. After 19, the next number is 1A. This goes on forever.

Hexadecimal 9 A B C D E F 10 11… 19 1A 1B 1C… 9F A0
Decimal 9 10 11 12 13 14 15 16 17 25 26 27 28 159 160

Digits are explained as powers of 16. Consider the hexadecimal number 2DB7.

163 162 161 160
2 D B 7
8192+3328+176+7
11703

As you can see, placements in hexadecimal are worth a whole lot more than in any of the other three number systems.

Conversion

It is important to know that 364 in octal is not equal to the normal 364. This is just like how a 10 in binary is certainly not 10 in decimal. 10 in binary (this will be written as 102 from now on) is equal to 2. 108 is equal to 8. How on earth do we know this? What is 20C.38F16, and how do we find out?

Here is why it is important to understand how the number systems work. By using our powers of the base number, it becomes possible to turn any number to decimal and from decimal to any number.

Base to Decimal

So, we know that 3648 is not equal to the decimal 364. Then what is it? There is a simple method in converting from any base to the decimal base ten. If you remember how we dissected the numbers above, we used powers, such as 24, and ended up with a number we understand. This is exactly what we do to convert from a base to decimal. We find out the true value of each digit according to their placement and add them together.

In a formula, this algorithm looks like:

(1)
\begin{equation} V_{10} = v_pB^p+v_{p-1}B^{p-1}+...+v_1B+v_0 \end{equation}

Where V10 is the decimal value, v is the digit in a placement, p is the placement from the right of the number assuming the rightmost placement is 0, and B is the starting base. Do not be daunted by the formula! We are going to go through this one step at a time.

So, let us say we had the simple hexadecimal number 2B. We want to know what this number is in decimal so that we can understand it better. How do we do this?

Let us use the formula above. Define every variable first. We want to find V10, so that is unknown. The number 2B16 has two positions since it has two digits. p therefore is one less than that1, so p is 1. The number is in base 16, so B is 16. Finally, we want to know what v is, but there are multiple v's. You have v1 and v0. This refers to the value of the digit in the subscripted position. v1 refers to the digit in position one (the second digit from the right). So, v1 is 2. v0 is the first digit which is B. In the case of the conversion, you must convert all the letters to what they are in decimal. B is 11 in decimal, so v0 is 11.

Now, plug all this into the formula:

(2)
\begin{align} V_{10} = 2(16^1)+11(16^0) \\ V_{10} = 2(16)+11(1) \\ V_{10} = 32+11 \\ V_{10} = 43 \\ \end{align}

Therefore, 2B16 is equal to 43.

Now, let me explain how this works. Remember how digit placement affects the actual value? For example, in the decimal number 123, the "1" represents 100 which is 1*102. The "2" is 20, or 2*101. Likewise, in the number 2B16, the "2" is 2*161, and the B is 11*160.

We can determine the value of numbers in this way. For the number 3648, we will make a chart that exposes the decimal value of each individual digit. Then, we can add them up so that we have the whole. The number has three digits, so starting from the right, we have position 0, position 1, and position 2. Since this is base eight, we will use powers of 8.

82 81 80
3 6 4

Now, 82 is 64. 81 is 8. 80 is 1. Now what?

Remember what we did with the decimal number 123? We took the value of the digit times the respective power. So, considering this further…

3*64 6*8 4*1
192 48 4

Now, we add the values together to get 244. Therefore, 3648 is equal to 24410.

In the same way that for 123, we say there is one group of 100, two groups of 10, and three groups of 1, for octal and the number 364, there are three groups of 64, six groups of 8, and four groups of 1.

Decimal to Base

Just like how we can convert from any base to decimal, it is possible to convert decimal to any base. Let us say that we want to represent the number 23610 in binary, octal, and hexadecimal. What we need to do is pretty much reverse whatever we did above. There isn't really a good formula for this, but there is an algorithm that you can follow which will help accomplish what we want.

(3)
\begin{align} (1) \hspace{6pt} Let \hspace{4pt} P = \operatorname{int}(\sqrt[B]{V}) \\ (2) \hspace{6pt} Let \hspace{4pt} v = \operatorname{int}(V \div B^P) \\ (v \hspace{4pt} is \hspace{4pt} the \hspace{4pt} next \hspace{4pt} digit \hspace{4pt} to \hspace{4pt} the \hspace{4pt} right) \\ (3) \hspace{6pt} Make \hspace{4pt} V = V-vB^p \\ (4) \hspace{6pt} Repeat \hspace{4pt} steps \hspace{4pt} 1 \hspace{4pt} through \hspace{4pt} 3 \hspace{4pt} until \hspace{4pt} p=0 \\ \end{align}

This algorithm may look confusing at first, but let us go through an example to see how it can be used. We want to represent 236 in binary, octal, and hexadecimal. So, let's try getting it to binary first.

The first step is to make p equal to $\operatorname{int}(\sqrt[B]{V})$. B is the base we want to convert to which is 2. The V is the number we want to convert, 236. Essentially, we are taking the square root of 236 and disregarding the decimal part. Doing this makes p become 7.

Step two says to let v equal our number V divided by Bp. Bp is 27, or 128, and the integer part of 236 divided by 128 is 1. Therefore, our first digit on the left is 1. Now, we actually change V to become V minus the digit times the Bp. So, V will now be 236-128, or 108.

We simply repeat the process until the p becomes a zero. When p becomes zero, we complete the steps a last time and then end.

So, since V is now 108, p becomes 6. 108 divided by 26 is 1. The 1 goes to the right of the 1, so now we have 11. V becomes 44 since 108-64 is 44.

How?

Now you might be asking yourself how to read these numbers. Well, that’s not so difficult. First, I’ll give a general mathematical explanation which can be fit into one formula:

(4)
\begin{equation} V=vB^P \end{equation}

In human language: the value of the cipher in the number is equal to the value of the cipher on its own multiplied by the base of the number system to the power of the position of the cipher from left to right in the number, starting at 0. Read that a few times and try to understand it.

Thus, the value of a digit in binary doubles every time we move to the left. (see table below)

From this follows that every hexadecimal cipher can be split up into 4 binary digits. In computer language: a nibble. Now take a look at the following table:

Binary Numbers
8 4 2 1 Hexadecimal Value Decimal Value
0 0 0 0 0 0
0 0 0 1 1 1
0 0 1 0 2 2
0 0 1 1 3 3
0 1 0 0 4 4
0 1 0 1 5 5
0 1 1 0 6 6
0 1 1 1 7 7
1 0 0 0 8 8
1 0 0 1 9 9
1 0 1 0 A 10
1 0 1 1 B 11
1 1 0 0 C 12
1 1 0 1 D 13
1 1 1 0 E 14
1 1 1 1 F 15

Another interesting point: look at the value in the column top. Then look at the values. You see what I mean? Yeah, you’re right! The bits switch on and off following their value. The value of the first digit (starting from the right), goes like this: 0,1,0,1,0,1,0,1,0,1,… Second digit: 0,0,1,1,0,0,1,1,0,0,1,1,0,0… Third digit (value=4): 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,… And so on…

Now, what about greater numbers? Therefore we’ll need an extra digit. (but I think you figured that out by yourself). For the values starting from 16, our table looks like this:

Binary Numbers
16 8 4 2 1 Hexadecimal Value Decimal Value
1 0 0 0 0 10 16
1 0 0 0 1 11 17
1 0 0 1 0 12 18
1 0 0 1 1 13 19
1 0 1 0 0 14 20
1 0 1 0 1 15 21
1 0 1 1 0 16 22
1 0 1 1 1 17 23
1 1 0 0 0 18 24
1 1 0 0 1 19 25
1 1 0 1 0 1A 26
1 1 0 1 1 1B 27
1 1 1 0 0 1C 28
1 1 1 0 1 1D 29
1 1 1 1 0 1E 30
1 1 1 1 1 1F 31
For octals, this is similar, the only difference is that we need only 3 digits to express the values 1->7. Our table looks like this:
Binary Numbers
4 2 1 Octal Value Decimal Value
0 0 0 0 0
0 0 1 1 1
0 1 0 2 2
0 1 1 3 3
1 0 0 4 4
1 0 1 5 5
1 1 0 6 6
1 1 1 7 7

Conversion.

In the latter topic I explained the logic behind the binary, hexadecimal and octal number systems. Now I’ll explain something more practical. If you fully understood the previous thing you can skip this topic.

From decimal to binary

  • Step 1: Check if your number is odd or even.
  • Step 2: If it's even, write 0 (proceeding backwards, adding binary digits to the left of the result).
  • Step 3: Otherwise, if it's odd, write 1 (in the same way).
  • Step 4: Divide your number by 2 (dropping any fraction) and go back to step 1. Repeat until your original number is 0.

An example:
Convert 68 to binary:

  • 68 is even, so we write 0.
  • Dividing 68 by 2, we get 34.
  • 34 is also even, so we write 0 (result so far - 00)
  • Dividing 34 by 2, we get 17.
  • 17 is odd, so we write 1 (result so far - 100 - remember to add it on the left)
  • Dividing 17 by 2, we get 8.5, or just 8.
  • 8 is even, so we write 0 (result so far - 0100)
  • Dividing 8 by 2, we get 4.
  • 4 is even, so we write 0 (result so far - 00100)
  • Dividing 4 by 2, we get 2.
  • 2 is even, so we write 0 (result so far - 000100)
  • Dividing 2 by 2, we get 1.
  • 1 is odd, so we write 1 (result so far - 1000100)
  • Dividing by 2, we get 0.5 or just 0, so we're done.
  • Final result: 1000100

From binary to decimal

  • Write the values in a table as shown before. (or do so mentally)
  • Add the value in the column header to your number, if the digit is turned on (1).
  • Skip it if the value in the column header is turned off (0).
  • Move on to the next digit until you’ve done them all.

An example:
Convert 101100 to decimal:

  • Highest digit value: 32. Current number: 32
  • Skip the "16" digit, its value is 0. Current number: 32
  • Add 8. Current number: 40
  • Add 4. Current number: 44
  • Skip the "2" and "1" digits, because their value is 0.
  • Final answer: 44

From decimal to hexadecimal.

THIS IS ONLY ONE OF THE MANY WAYS!

  • Convert your decimal number to binary
  • Split up in nibbles of 4, starting at the end
  • Look at the first table on this page and write the right number in place of the nibble

(you can add zeroes at the beginning if the number of bits is not divisible by 4, because, just as in decimal, these don’t matter)

An example:
Convert 39 to hexadecimal:

  • First, we convert to binary (see above). Result: 100111
  • Next, we split it up into nibbles: 0010/0111 (Note: I added two zeroes to clarify the fact that these are nibbles)
  • After that, we convert the nibbles separately.
  • Final result: 27

From hexadecimal to decimal

*Check the formula in the first paragraph and use it on the ciphers in your hexadecimal number. (this actually works for any conversion to decimal notation)

An example:
Convert 1AB to decimal:

  • Value of B = 160×11. This gives 11, obviously
  • Value of A = 161×10. This gives 160. Our current result is 171.
  • Value of 1 = 162×1. This gives 256.
  • Final result: 427

From decimal to octal

  • Convert to binary.
  • Split up in parts of 3 digits, starting on the right.
  • Convert each part to an octal value from 0 to 7

Example: Convert 25 to octal

  • First, we convert to binary. Result: 11001
  • Next, we split up: 011/001
  • Conversion to octal: 31

From octal to decimal

Again, apply the formula from above

Example: convert 42 to decimal

  • Value of 2=80×2=2
  • Value of 4=81×4=32
  • Result: 34

Fun Facts

OK, these may not be 100% "fun", but nonetheless are interesting.

  • Do you tend to see numbers beginning with 0x? This is common notation to specify hexadecimal numbers, so you may see something like:
0x000000
0x000002
0x000004

This notation is most commonly used to list computer addresses, which are a whole different story.
  • This is pretty obvious, but you can "spell" words using hexadecimal numbers. For example:
    • CAB = 3243 in decimal notation.

End

Did you understand everything? If you think so, test yourself:

Bin Dec Hex
3A
76
101110
88
1011110
47

Make some exercises yourself, if you want some more.

Lists are one of the most used data types, and they can hold up to 999 elements (the only exception is the TI-83, which can only hold 99 elements). You can also name your own lists, making it the most secure data type available on the TI-83 calculators.

Note: To programmers coming from computers, this is the equivalent of a one-dimensional array.

Before You Start

There are two "types" of lists: predefined and custom. Predefined lists are L₁…L₆, and are accessible by pressing 2nd 1-6 respectively. The casual calculator user is probably using these, so don't use these if you don't have to. Custom lists start with a tiny uppercase ∟, and have a maximum of five characters afterward. You can have lists such as ∟LUNCH, or ∟TODO, or ∟GRR. We will be working with custom lists on this page.

Setting Up Lists

To create a list, all you have to do is this:

:5→dim(∟LIST)

The dim( command creates the list, and the number 5 being put in it tells the list how many elements it has to have in it. But what if you archived it when the program was run last? Then, you need to unarchive it using the UnArchive command:

:UnArchive ∟LIST
:5→dim(∟LIST)

But wait, it isn't that easy! If you try to unarchive something that doesn't exist, you get an ERR:UNDEFINED error! So, we must make sure the list is created first, by using the dim( command. But, if the list does exist and it is archived, we must unarchive it first! What to do, what to do.
You could either wait until the user says whether or not the list exists (not the best choice), or you can use another command available called SetUpEditor.

SetUpEditor

When you use SetUpEditor, you put the name of the list afterwards, like SetUpEditor ∟LIST. If the list doesn't exist, it gets created, if it is archived, it gets unarchived; and if nothing special happened to it, it just does nothing. This one command fixes what would take quite a few lines of code and the possibility of user error. You can then use the dim( command to specify the number of elements in the list. You can use it like so:

:SetUpEditor ∟LIST
:5→dim(∟LIST)

Now your list is set up! Note that for custom lists, the ∟ prefix is not required.

Using a list

Writing

It isn't that hard to use a list. To write something to it, for example, you use this code:

:5→∟LIST(1)

This code writes the number five the the first element of the list. (Computer programmers: the index starts at 1, not 0) To write the first 5 powers of 2 into each element, starting at the first element (with the number 2 inside), you can use this code:

:SetUpEditor ∟LIST
:5→dim(∟LIST)
:For(L,1,5)
:2^L→∟LIST(L)
:End

Inside of the For( loop, we go through each respective element of ∟LIST and store the respective power of 2 into it. The end result of the list is {2 4 8 16 32}.

Reading

Reading from a list is just as easy. To put an element from a list into the variable X, you use this command:

:∟LIST(1)→X

To display the element without storing into the variable, you can do something like:

:Disp ∟LIST(1)

Now, what if the program we made earlier was supposed to show the results? We would modify it like so:

:ClrHome
:SetUpEditor ∟LIST
:5→dim(∟LIST)
:For(L,1,5)
:2^L→∟LIST(L)
:Disp ∟LIST(L)
:End

The first addition is at the very top. ClrHome is just a precautionary measure. The second addition is just before the End, and that is the Disp command, which displays element number L on the screen. Try out the program, and you should see on the home screen:

2
4
8
16
32
Done

Finishing Up

You need to do, at the most, only two things to clean up your list use.

The first is to archive your list using the Archive command, if you want to protect it until next time. Or, if it is only used to hold temporary variables, you can delete it with Delvar.

The second is to SetUpEditor, like so:

:SetUpEditor

This sets up the Edit… command (on the STAT button) so that it allows edit of L₁…L₆. Don't use this, and the student who clicks on Edit… will see ∟GAME appear just as the teacher walks to check on him, and oops.

<< Data Types (intro) Table of Contents Data Types (matrices) >>
The ListPages module does not work recursively.

{$heading}
Besides reading the programming information that the wiki provides, there are several additional TI-Basic tutorials and guides that other people have created that you might find handy. As quality tutorials and guides are hard to come by for TI-Basic and Assembly, some of the tutorials and guides listed here are not that great (they are unfinished or have holes in their content). Still, having the information to read and learn from is better than the converse.
Name Author
UCS TI-Basic Tutorial ?
TI Source - TI-83+ Basic Programming ?
TI-Freakware BASIC Tutorial Daniel Thorneycroft
Kerm Martian's Complete TI-83/+/SE BASIC Tutorials Kerm Martian
BASIC Guru Online Tutorials Ben Ilegbodu
TI 83 BASIC Tutorial Jacob W. Tatay
TI-83 BASIC Tutorial (Portuguese) Sérgio Santos
Basic on TI-82-83+SE Yannick Wrtal
Programming On The TI-82 Andy Gelzleichter
BASIC Tutor Hieu-Trung Le
Programming with the TI-83 Chris Neugebauer
mjs2000 inc. Tutorials ?
Rogue's TI-86 Basic Tutorial ?
HeaneySoft BASIC Tutorial ?
TI-83 Programming Tutorials Lue Her and Andy Becker
TI-BASIC for noobs ?
Resource Description
TI-Basic IRC Channel The #Optimize channel over at United-TI is for TI-Basic code and optimization help. Besides Weregoose, the moderator, there are several other people willing and capable to help beginners (and anyone else) with whatever problems or questions they have. It is a very friendly environment.
TI-Basic Sidebar The TI-Basic Sidebar is a list of the TI-83/84/+/SE commands organized alphabetically for quick reference. Clicking a command link opens up the respective command page on TI-Basic Developer in the main browser window. The sidebar appears as a bookmark in the bookmarks list, and clicking on the bookmark opens up a new frame in the browser.

Routine Summary

Draws an ellipse with specified coordinates.

Inputs

(A,B) - upper left corner, in pixels
(C,D) - lower right corner, in pixels

Outputs

Ellipse inscribed in the rectangle from (A,B) to (C,D)

Variables Used

A,B,C,D for input
∟X and ∟Y store a sin/cos look-up table
Plot1 to store the unit circle
Pic1 to preserve background

Calculator Compatibility

All

Author

Mikhail Lavrov (DarkerLine)

URL: http://mpl.unitedti.org/?p=13

Setup:

:cos(.1πcumSum(binomcdf(20,0→X
:sin(.1πcumSum(binomcdf(20,0→Y
:Plot1(xyLine,∟X,∟Y,(dot)
:PlotsOff

Main code:
:StorePic 1
(:ZoomSto)
:-(B+D)/abs(D-B→Xmin
:(A+C-124)/abs(C-A→Ymin
:2/abs(D-B→ΔX
:2/abs(C-A→ΔY
:PlotsOn 1
:RecallPic 1
:StorePic 1
:PlotsOff
(:ZoomRcl)
:RecallPic 1

To use the routine, add the setup code to the beginning of your program. Then, to draw an ellipse, initialize (A,B) and (C,D) to be opposite corners of an imagined rectangle, in pixel coordinates, and run the main code of the routine. The ellipse will be drawn inside this rectangle (much like the functionality of the circle tool in Paint). Unlike built-in pixel commands, this routine doesn't require the pixels to be on-screen: you can use negative coordinates, and coordinates past the 62nd row and 94th column - of course, if you do, then the off-screen part of the ellipse won't be drawn.

As for speed, the routine is far faster than the Circle( command. If you use Circle( with its undocumented fourth argument, that is a bit faster still - but doesn't allow you as much control over the shape of the ellipse as this routine does.

This routine draws an ellipse given its pixel coordinates in two overall steps:

  1. First, it calculates the window dimensions so that the unit circle (centered at the origin, with radius 1) will be stretched to the required pixel coordinates.
  2. Next, it draws the unit circle.

If the unit circle is stretched to fit in the rectangle from (A,B) to (C,D) then we know the following:

  • The vertical distance from A to C (in pixel rows) should be equivalent to the window distance 2 (from -1 to 1). This allows us to solve for ΔY.
  • The horizontal distance from B to D (in pixel columns) should also be equivalent to the window distance 2. This allows us to solve for ΔX.
  • The pixel most nearly corresponding to the midpoint between (A,B) and (C,D) should be equivalent to the point (0,0), the center of the circle. Given ΔX and ΔY, this allows us to solve for Xmin and Ymin.

The exact math isn't significant, but it gives rise to the formulas you see in the routine. Note that by using the abs( command, we ensure that the order of the two points (A,B) and (C,D) isn't important: you can switch A and C, or B and D, and still get the same circle.

The code for actually drawing the circle uses a look-up table for sine and cosine (which defines 20 points spaced around the circle). The table is calculated in the setup code, and then an xyLine plot is initialized, which will connect these 20 points when graphed. Now, to draw the unit circle, all that needs to be done is to enable the plot, using the PlotsOn command. This actually draws a 20-gon, rather than a circle, but the difference is imperceptible even on large circles.

The rest of the code is necessary to preserve the graph screen as the window changes and Plot1 is enabled and disabled (which causes the screen to be cleared), using StorePic and RecallPic. Optionally, you can also preserve the window dimensions, using ZoomSto and ZoomRcl — this is useful if your program mixes pixel and point commands.

The routine uses three fairly large variables to do its work: ∟X, ∟Y, and Pic1. ∟X and ∟Y need to be preserved from the setup code to whenever the routine is called; Pic1 is only used temporarily. It's a good idea to clean up all three by deleting them at the end of the program.

{$strategyBegin}
Name Size Libraries? Compatibility Author
Bang Bang 3,670 No TI-83/84/+/SE Sean Weeks
Checkers 13,249 No TI-83/84/+/SE nitacku
Chess Pro 6,869 No TI-83/84/+/SE Francis Huang
Connect 4 4,000 No TI-83/84/+/SE SiCoDe
Dots 1,311 No TI-83/84/+/SE Travis Fischer
Lights Out 3,400 No TI-83/84/+/SE Scott Davis
Minesweeper 3,339 Yes TI-83+/84+/SE Fred Sparks
World Domination 10,000 No TI-83/84/+/SE Kerm Martian
World Empire 5,714 No TI-83/84/+/SE Arthur O'Dwyer
Xmove15 1,574 No TI-83/84/+/SE XprO

{$strategyEnd}

{$rpgBegin}
Name Size Libraries? Compatibility Author
Castle Adventure 6,700 No TI-83/84/+/SE Arthur O'Dwyer
Metroid Pi 17,000 No TI-83/84/+/SE Harrierfalcon

{$rpgEnd}

{$sportsBegin}
Name Size Libraries? Compatibility Author
Bowling 16,384 Yes TI-83+/84+/SE Nitacku
Slam Session 4,200 No TI-83/84/+/SE Jason Russell

{$sportsEnd}

{$puzzleBegin}
Name Size Libraries? Compatibility Author
Brick Block 7,500 No TI-83/84/+/SE SiCoDe
Donut Quest 10,276 No TI-83/84/+/SE Mikhail Lavrov
DStar 4,800 No TI-83/84/+/SE Scott Davis
Lode Runner 3,000 No TI-83/84/+/SE SiCoDe
Sudoku 4,051 No TI-83/84/+/SE Harrierfalcon
Tower Of Hanoi 2,783 No TI-83/84/+/SE Martin Johansson

{$puzzleEnd}

{$arcadeBegin}
Name Size Libraries? Compatibility Author
Blizz 1,863 No TI-83/84/+/SE Martin Johansson
Bomberman 4,969 No TI-83/84/+/SE Travis Fischer
Contra 10,000 No TI-83/84/+/SE Bryan Thomas
Dino Eggs 2,357 No TI-83/84/+/SE Alex Snyder
Frogger 1,232 No TI-83/84/+/SE SiCoDe
Nibbles Arcade 7,261 No TI-83/84/+/SE SiCoDe
Pipes 5,276 No TI-83/84/+/SE Sean Sartell
Snake Escape 1,120 No TI-83/84/+/SE Alex Snyder
Tetris 2,877 No TI-83/84/+/SE Nitacku
War 2,000 No TI-83/84/+/SE SiCoDe
Xsnake 1,468 No TI-83/84/+/SE XprO

{$arcadeEnd}

{$casinoBegin}
Name Size Libraries? Compatibility Author
Commerce 5,300 No TI-83/84/+/SE Arthur O'Dwyer
Solitaire 3,993 No TI-83/84/+/SE Nitacku
Yahtzee 6,329 No TI-83/84/+/SE Brad Wentz

{$casinoEnd}

{$miscellaneousBegin}
Name Size Libraries? Compatibility Author
Civilization Simulator 13,000 No TI-83/84/+/SE Kerm Martian
Office XE 21,076 No TI-83/84/+/SE Brad Wentz

{$miscellaneousEnd}

One of the great things about working with TI Basic is that people are always developing new routines. This page is where you can display code for things that you think could be better than currently accepted routines.

GetKey Routines

This alternate routine is a size optimization of the usual movement routine used to move a character around the screen (9 bytes less than the regular routine). It is a replacement for the currently accepted movement routine. It was discovered by Darkstone Knight and Burr and implemented by Basickevin.

:4→A
:8→B
:While 1
:getKey→K
:1
:If K
:" //one space//
:Output(A,B,Ans
:min(8,max(1,A+sum(Δlist(K={25,34→A
:min(16,max(1,B+sum(Δlist(K={24,26→B
:End

This is Basickevin's speed optimization of the same routine. It's about 15% faster, 25 bytes larger, and the variables are all under the finanace window.

:4→PMT
:1→FV
:While 1
:getKey→PV
:If PV
:Output(PMT,FV," //one space//
:min(8,max(1,PMT+sum(Δlist(PV={25,34→PMT
:min(16,max(1,FV+sum(Δlist(PV={24,26→FV
:Output(PMT,FV,1
:End

References

Routine Summary

A simple instant messaging program.

Inputs

Str3

Outputs

None

Variables Used

A, Str1, Str2, Str3

Calculator Compatibility

TI-83/84/+/SE

Author

James Kanjo

Download

im.zip

:"→Str1
:"→Str2
:GetCalc(A
:e(A=π)+π(A≠π→A
:Lbl M
:ClrHome
:Menu("IM","READ",R,"SEND",S,"QUIT",Q
:Lbl S
:Input "SEND MESSAGE:   ",Str3
:If A=π:Str3→Str1
:If A=e:Str3→Str2
:Goto M
:Lbl R
:If A=e:Then
:GetCalc(Str1
:Str1
:Else
:GetCalc(Str2
:Str2
:End
:Output(1,1,Ans
:Pause :Goto M
:Lbl Q

An "Instant Messaging" program, is a program that allows you to have an "instant" conversation with another person via a computer of some sort. With this program, you must connect two calculators via the calculator-calculator cable (it's about 22 centimetres long) before initiating the program on both calculators. Using this program means that you can be massive 22 centimetres away from a friend, and STILL be able to have conversations with them.

Obviously this is a silly program, but its real purpose is to demonstrate the calculator's capacity to communicate with other calculators — and it's a great 'learning program'.

Firstly, the program resets the Str1 and Str2 variables, which are used to later display "received messages", and executes the getcalc( command to retrieve variable A from the connected calculator. Then the program does something tricky; it checks to see if the variable A is equal to π (pi). If so, then it sets variable A to e. If A does not equal π, then π is stored to A. This is a complicated process which gives each calculator it's own identity — a vital part of cross-calculator programs.

The menu then appears giving the user options to "receive" a message, "send" a message and to "quit". When the user tries to send a message, the program retrieves the user's input and temporarily stores it into Str3. The program then stores Str3 to variables Str1 or Str2, depending on the value of A. When the user goes to retrieve a message, depending on the value of A, it selectively retrieves Str1 or Str2 from the other calculator, which is the message that the other user has "sent".

Of course, this isn't true instant messaging, but is at the least a simulation of it. Because the GetCalc( command retrieves data from another calculator, the other calculator needs to be idle to be able to send it. This program works because both calculators are always idle — in the menu, when typing a message and when reading a message. This routine uses Str1, Str2 and Str3, which you should clean up at the end of your program.

While the contribute and conventions pages answer the general questions about how to create and edit pages, this page answers the specific questions about editing the homepages and any specialty pages (such as the command pages). If you have any questions that aren't mentioned, please leave a post in the forum or make a comment at the bottom of the page.

Uploading files

There is now a tutorial to upload files on the site.

Recent News

When you add some new content to the wiki, it is always recommended that you let the community know what you have done — especially if you made some significant edits.

Each news item is stored on it's own page in the news category, including appropriate tags about the page; _news _83portal _68kportal _both-portals. These tags help us to automatically organise the news into categories. You can add news through the add news page.

The news can be viewed through the 83 news, 68k news and all news pages. The portal home pages also automatically retrieve the 5 most recent news elements relative to their portal of the site.

New Members

We love to encourage people to become members and contribute to improve the quality of the site. This is why we decided to compile a list of every member in the chronological order that they joined. From this page, we are able to show our appreciation with a warm welcome on the home pages to the newest members of the community.

Unfortunately, this is a manual process — a member needs to regularly check the automatic list on the members page for any new members. If you notice that a new member has joined, please take it upon yourself to update the list.

Home Infobox

On the home pages of the 83 and 68k portals, there is an infobox on the right-hand side of the page. This infobox provides some short, but useful information about some of the different sections of the site: how to get involved, what's happening in the forums, some interesting TI-Basic tidbits, the "top 10" rated programs, the featured article and the featured command.

These things are not actually editable on the home pages themselves, but instead are automatically retrieved from other pages on the site — which is quite useful because it saves us from having to create duplicate copies of the same information. To manipulate these pages, just visit their appropriate links, and follow the instructions on those pages:

TI-83 Infobox: TI-68k Infobox:
83 Did You Know for Did you know… items.
83 Featured Command for the featured command.
83 Featured Article for the featured article.
68k Did You Know for Did you know… items.
68k Featured Command for the featured command.
68k Featured Article for the featured article.

Include Pages

TI-Basic Developer utilizes the convenience of "include templates" throughout the site (a list of which can be found on the inc:overview page). These special pages are included as part of another page, and are used as templates for similar sections of code repeated amongst many pages (and hence, their name).

For example, each command page has an infobox on the right-hand side giving specific details about the command. To get the template, we type in [[include inc:command, and then type in the values. This is much simpler and easier to use than typing out the whole infobox for each command, not to mention easier to understand and manage.

For specific details on how to use all of the include templates, see the inc:overview page.

Privileges Required

There are some pages on the site which can't be edited by ordinary members alone. This is because we believe that some pages just don't need editing, and don't need to risk being tampered with. In such cases that you believe one of these pages can be improved, then you have one of two options:

  1. Start a discussion page in the forums; or
  2. Send a private message to one of the administrators or moderators.

Both options are effective, and so the decision is a matter of preference. If you want the community's opinion on the matter, post it in the forums. If you prefer to keep your conversations private, just send a private message: click on the avatar of the person, and click on the link saying "write private message".

Program Archives

When people upload programs to the archives, it is up to us to do the hard work and integrate their program pages with the rest of the site. If you see any programs pending in the _to-do page, there are a few things you need to do:

  1. Edit the page source — click on the "edit" button at the bottom of the page, then:
    • Paste the image URL (if any) in the |picture= section
    • Paste the program URL in the |downloadUrl= section
    • Copy the program file name in the |downloadName= section (for example, type in "Game.zip")
  2. Click on the "save" button;
  3. Remove the "_pending" tag — click on the "tag" button at the bottom of the page, and delete ONLY the "_pending" tag.

You may want to see the full details of the tablet include.

The featured commands are articles that represent the best TI-Basic Developer has to offer. A featured command meets all of the following requirements:

  • Well-Written — It is easy to read, flows smoothly, and does not have any spelling or grammatical errors.
  • Complete — It includes everything about the command, including theory, code examples, and screenshots, when appropriate.
  • References — If applicable, it lists the sources that were used in putting together the command.

To nominate a command for being featured, add it to the list below.

Featured Command Candidates:

  • None so far… feel free to nominate one!

Featured Commands:

The ListPages module does not work recursively.

{$part1begin}

To add a command, move the current featured command from {$part2} to {$part3}, and add a new featured command to {$part2}. See the featured commands page to view the data on this page in a cosmetic format.

{$part1end}
{$part2begin}

The Menu( command displays a generic menu on the home screen, with up to seven options for the user to select from.

If you need more than seven options, you can create another menu and then link to that menu.
(more...)

{$part2end}
{$part3begin}

None yet…

{$part3end}

{$part1-start}

To add any new members on a new date, move the first date from {$part3} to {$part2}, and add a new date to {$part3}. The date format is day/month.

See the members page to view the data on this page in a cosmetic format.

{$part1-end}

{$part2-start}

2006

Sep 01 TI-Basic Developer wiki is started by burrburr using the content from his TI-Basic Developer guide as the foundation for the wiki.
Sep 02 alexruddalexrudd
Sep 02 Fallen GhostFallen Ghost
Sep 11 DarkerLineDarkerLine
Sep 24 Sage OratorSage Orator
Sep 24 calc84maniaccalc84maniac
Sep 25 HarqHarq
Oct 01 super_spelersuper_speler
Oct 22 adcurtinadcurtin
Oct 25 halg19halg19
Oct 25 airmintairmint
Oct 25 MgNateMgNate
Nov 04 elfprinceelfprince
Nov 06 lubyluby
Dec 08 Allen LiuAllen Liu

2007

Jan 17 HarrierfalconHarrierfalcon
Jan 18 WeregooseWeregoose
Feb 11 WikiGuruWikiGuru
Mar 21 blm22blm22
Mar 31 Jonn89Jonn89
Apr 11 XphoenixXphoenix
Apr 14 thornahawkthornahawk
Apr 16 xxfffreakxxxxfffreakxx
Apr 16 Baorder54Baorder54
May 15 ebscerebscer
Jun 11 GraeliGraeli
Aug 20 geemangeeman
Sep 04 pzhukkepzhukke
Sep 04 valentinevalentine
Oct 04 simplethinkersimplethinker
Nov 04 angel14995angel14995
Nov 13 JoostinOnlineJoostinOnline
Dec 12 AnkillitoAnkillito
Dec 18 Ein_HaldenlebenEin_Haldenleben
Dec 24 OninionOninion

2008

Jan 16 kalan_vodkalan_vod
Jan 18 brenns10 does not match any existing user name
Jan 21 whatifitsnotwhatifitsnot
Jan 26 SocksSocks
Jan 27 AcroAcro
Feb 03 Zaphod BeeblebroxZaphod Beeblebrox
Feb 10 CesiumCesium
Feb 12 ryborybo
Feb 23 RandomProductionsRandomProductions
Feb 28 prototypicalXprototypicalX
Mar 20 TroyLSandersTroyLSanders
Mar 23 Recipito does not match any existing user name
Mar 25 James KanjoJames Kanjo
Mar 25 BluedragonBluedragon
Mar 28 pokedotpokedot
Apr 10 AJLitzau13AJLitzau13
Apr 28 RevenantphoenixRevenantphoenix
May 04 krazynesskrazyness
May 04 lupus6x9lupus6x9
May 07 patriotsfanpatriotsfan
May 10 Nick53Nick53
May 26 basickevinbasickevin
May 31 MosquitoMosquito
Jun 06 Jonathan KingJonathan King
Jun 10 Edward HEdward H
Jun 10 NorinionNorinion
Jun 10 FlameviperFlameviper
Jun 10 piano_manpiano_man
Jun 11 MobiusIntellectusMobiusIntellectus
Jun 11 HedonismBotHedonismBot
Jun 11 zapperpostzapperpost
Jun 12 --dome91----dome91--
Jun 12 builderboybuilderboy
Jun 12 graphmastur does not match any existing user name
Jun 12 ZagorNBKZagorNBK
Jun 13 ArjenArjen
Jun 13 WordsHereWordsHere
Jun 14 darkstone knightdarkstone knight
Jun 18 Mapar007Mapar007
Jun 19 TowelyTowely
Jun 21 MallkuMallku
Jun 22 olin3434olin3434
Jun 25 froggy222froggy222
Jun 26 zerompzeromp
Jun 28 7thAce7thAce
Jul 01 perilquestperilquest
Jul 02 my_namemy_name
Jul 12 fractalpfractalp
Jul 18 architeuthiskidarchiteuthiskid
Aug 16 larry4624larry4624
Aug 16 papwalkerpapwalker
Aug 21 TI-86erTI-86er
Aug 25 GamuelGamuel
Aug 28 someon3426someon3426
Sep 07 noahbaby94noahbaby94
Sep 09 ePIiePIi
Sep 17 Timothy FosterTimothy Foster
Sep 17 Will WestWill West
Sep 23 snacks tastysnacks tasty
Sep 24 The RenegadeThe Renegade
Oct 02 programmarprogrammar
Oct 03 gumbeegumbee
Oct 04 nintendoriot101nintendoriot101
Oct 07 paintballnoobpaintballnoob
Oct 24 bxsciencer does not match any existing user name
Oct 25 LeperboyLeperboy
Oct 26 skuller972skuller972

{$part2-end}
{$part3-start}

Oct 27 ibly31ibly31
Nov 01 DrCoyoteDrCoyote
Nov 09 MasterDonut09 does not match any existing user name
Nov 12 RecipeRecipe
Dec 14 TI123outermeTI123outerme

{$part3-end}

Random Numbers provide the essence of most games. They keep that element of chance alive. You cannot substitute for random numbers without someone who plays the game over and over again to figure out a pattern. Below we will start a discussion of random numbers.

The Commands

rand

The rand command generates a random number between 0 and 1. It will display a decimal number longer than you can care for. It requires no arguments.
BUT WAIT! There is a secret function to rand. First we must tell you something: the calculator doesn't produce random numbers. It's true. Calculators use pseudorandom number generators. It uses a complex formula to create the "random" numbers, mainly by a processing cycle. The secret to the random numbers is something called the seed. The seed is a number that is used to determine these random numbers. It is the starting number used, and an algorithm is used to generate pseudorandom numbers. One example method is the middle-square method, which starts with the seed, squares the number, and takes the half of that number, and repeats the cycle to generate numbers. More information about random vs. pseudorandom numbers can be found in this Khan Academy video: https://www.youtube.com/watch?t=59&v=GtOt7EBNEwQ

The secret function to rand, is that you can set the seed using:

:x→rand

where x equals the number. Set the seed to 1 on two different calculators and they put out the same sequence of numbers.

Here's a trick. To set the seed to a random number, use this code:

:rand→X
:X→rand

rand can also be multiplied in order to get larger numbers. Just put a coefficient before rand. Also, you can generate a list of random numbers by doing this:

:rand(x)

This will generate a random list with x number of elements.

randBin(

This command randBin(numtrials,prob) requires two arguments. numbtrials specifies the number of trials, and prob requires a number between 0 and 1.
The manual's definition is this:
Generates and displays a random real number from a specified Binomial distribution.

randInt(

Ah, yes, this one. It's the most common random number command. It requires two arguments, both very simple.
The command is randInt(lower, upper). Lower specifies the minimum number possible. Upper specifies the maximum possible. For example, randInt(1,10) will generate a whole number between 1 and 10.
Here is a simple program that uses randInt(

:ClrHome
:Disp "Think of your"
:Disp "question and"
:Disp "press enter."
:Pause
:randInt(0,2)→X
:"Maybe"
:If X=1
:"Yes"
:If not(X)
:"No"
:Disp Ans

In this program, the user thinks of a question that he or she would ask a magic eight ball. It calculates a random integer between 0 and 2 (0, 1, or 2). It makes "Maybe" the default answer. The program then tests the random number under the conditions to make the string, "Maybe", change to "Yes", "No", or remain the same.

randM(

This may be not as well-known as the others. This command will generate a random matrix. The command syntax is randM(rows,columns). Rows stands for the number of rows in the matrix, columns for the number of columns. The numbers in the matrix are the random part.

randNorm(

This command will generate a number, with given randNorm(µ,σ), within the range µ±3σ. The command uses a normal distribution based on the 68-95-99.7 empirical rule. When the third argument is given, it will generate a list of that many elements.

Putting it Together

Let's make a program that will use the random commands. The program will be a game where it is you against the computer. You take turns where one player thinks of a number between 1 and 10, and the other player must guess as close as possible. The AI will use random numbers as his guess.

:rand→X
:X→rand
:ClrHome
:SetUpEditior L₁
:{30,30}→L₁
:Delvar A
:Repeat L₁(A)<0
:A(A≠2)+1→A

Okay, first we reset the seed. Then, we set up the game by storing each player's health into a list and deleting A, the turn. The loop starts and is set to end when a player's health reaches below zero. The next thing that happens is that the player number turn switches between 1 and 2, with human being 2 and AI being 1.
:If A=2
:Then
:Repeat N>0 and N≤10
:Input "Your Number?_",N
:int(N)→N
:End
:randBin(10,N/10)
:End

This is what happens when it is your turn. You must input a number where the calculator makes sure your number isn't less than 1 or greater than 10. It also ensures an integer number. The calculator uses a formulated guess which gives it a higher probability of guessing right (I know… cheap).
:If A=1
:Then
:Input "Guess?_",N
:abs(int(N))→N
:randInt(1,10)
:End

This is what happens when it is the calculator's turn. The calculator first randomly chooses a number, and then you are asked to give a guess. The calculator will not check for boundaries, but it will check for decimals.
:ClrHome
:L₁(A)-abs(N-Ans)→L₁(A)
:End
:ClrHome
:"You"+sub("Win!Lose",3(L₁(1)<0)+1,4)

This is the final part of the code where it takes the difference of the guesses and subtracts that from the turn player's opponent. When the game ends, it displays a message at the end.
:rand→X
:X→rand
:ClrHome
:SetUpEditior L₁
:{30,30}→L₁
:Delvar A
:Repeat L₁(A)<0
:A(A≠2)+1→A
:If A=2
:Then
:Repeat N>0 and N≤10
:Input "Your Number?_",N
:int(N)→N
:End
:randBin(10,N/10)
:End
:If A=1
:Then
:Input "Guess?_",N
:abs(int(N))→N
:randInt(1,10)
:End
:ClrHome
:L₁(A)-abs(N-Ans)→L₁(A)
:End
:ClrHome
:"You"+sub("Win!Lose",3(L₁(1)<0)+1,4)

That sums up random numbers, and the last section of this chapter. We hope you learned a lot.
<< Data Types (strings) Table of Contents Summary >>

An algorithm refers to your method of solving a problem. Algorithmic optimization, then, relies on choosing the best method to solve a particular problem. Although we could choose a complex problem to illustrate algorithmic optimization, a simpler problem is equally sufficient in demonstrating the process that you go through.

For our example problem, imagine that you want to reverse the characters in a string: if the string is "HELLO", you want it to be "OLLEH". This obviously is a routine that would only really be useful if you are writing a text editor, and are providing different ways for the user to manipulate the text (search, replace, insert, copy, etc.).

Knowing what the routine needs to do, the straightforward approach to writing it is to use another string to store the reversed string, and then concatenating the respective substring to the end of the string while looping over the original string backwards using a For( loop. Here is what the code would look like:

:" "
:For(I,length(Str1),1,-1
:Ans+sub(Str1,I,1
:End
:sub(Ans,2,length(Ans)-1→Str1

As you can see, we are using the Ans variable to hold our temporary string of reversed characters. You should also note that we initialize it to one space before entering the For( loop. This is because TI-Basic does not allow empty strings — it will actually return a ERR:DOMAIN if you try to concatenate or manipulate the string.

Although this approach is efficient, there are still other ways to write the routine. One possibility is using recursion — the program calling itself. This is basically replicating what the For( loop was doing in the previous routine, except this time we don't have an additional variable to keep track of the string position. Instead we are using the actual length of the string itself, and then subtracting the length of the temporary string from that.

In order for this to work, however, we need to add an additional character to the end of our string. This is because our temporary string is initialized to a space, so we need to offset this character to get the complete reversed string. If we don't add the extra character, our reversed string will be missing the first character from the original string — we would get "LLEH" instead of "OLLEH".

The actual code for the routine is:

:Ans+sub(Str1,length(Str1)-length(Ans),1
:If length(Ans)<length(Str1
:prgmREVERSTR
:sub(Ans,2,length(Ans)-1→Str1

Note that in order to run the routine, you need to initialize Ans on the home screen to a string with one character: a space is the character we like to use, but it can be a question mark, a letter, a number, or whatever you want. Also note that the program name must be the actual name of the program on your calculator; we just called our program REVERSTR because we like names that are descriptive.

When you try out this routine, you should notice that it works just as effectively as the first routine for short or medium length strings. However, if you try using a long string, the routine might not actually complete, but instead the calculator will run out of memory — giving you a ERR:MEMORY error.

Each time a program call is made, the calculator puts it on a stack and it takes sixteen bytes to keep track of each program call. Because this stack is placed in RAM, whether you are able to completely reverse the string or not depends on how much free RAM you have on your calculator.

The other problem with using this routine is that it has to be its own stand-alone program. This is because the code has to go at the beginning of the program, in order for the recursion to work correctly. Of course, a four line program isn't necessarily bad, but it can be a nuisance having to remember an additional program to use your program.

Using recursion to reverse a string is obviously not going to work for us when you factor in the memory for the program calls and the additional program, so that means we should stick to using a For( loop. Now we need to think about how else we could go about reversing a string.

How about instead of looping over the string backwards and appending the respective substring to the end of the string, we loop forwards and append the substring to the beginning of the string? Does that sound like it would work any better? Well, let's try it.

We are still going to use the temporary string stored in Ans like we did with the other two routines, except this time the original string is stored to Ans instead of just a dummy character. We then loop through each character starting from the beginning to the end, adding it to the beginning of the string as we build up the reversed string.

Here is what the code would look like:

:Str1
:For(I,1,length(Ans)-1
:sub(Ans,2I,1)+Ans
:End
:sub(Ans,1,I→Str1

Since adding to the beginning of the string alters the index, we must take that into account — this is where the 2I in the formula comes from. It adds the 2nd character the first time, the 4th character (which was originally the 3rd) next, the 6th character (originally the 4th) after that, and so on.

Comparing the size of the last routine to the size of the first two routines, the code is now smaller, and so coming up with a better algorithm has resulted in a better program. Of course, this required some creative thinking on our part, but it was well worth the effort.

[[include inc:routine
|picture=@@
|summary=@@
|input=@@
|output=@@
|variable=@@
|compatibility=@@
|author=@@
|authors=@@
|url=@@
|download=@@
]]

|picture=

If the image is embedded on the same page, then only the full name of the image is to be written here. Otherwise, simply paste the full URL of the image.

|summary=

Just type in a brief description of the routine

|input=

Enter all inputs required for the routine to work, and include a brief description of what they are

|output=

Enter all outputs the routine generates, and include a brief description of what they are

|variable=

Just give a brief description of all variables the routine uses

|compatibility=

Enter the calculators compatible with a syntax similar to the example used for all calculators: TI-83/84/+/SE

|author=

Enter the author of the routine, if only one person created it

|authors=

Enter a list of authors of the routine, if more than one person created it

|url=

Enter a URL to any relevant or related websites, followed by a space, and what you want to display. For example: |url=http://www.unitedti.org Routine's Derivative

|download=

Enter the URL to a downloadable version of the routine, followed by a space, and what you want to display. For example: |url=http://tibasicdev.wikidot.com/routine.zip routine.zip

[[include inc:program
|picture=@@
|summary=@@
|size=@@
|libraries=@@
|compatibility=@@
|author=@@
|download=@@
]]

|picture=

If the image is embedded on the same page, then only the full name of the image is to be written here. Otherwise, simply paste the full URL of the image.

|summary=

Just type in a brief description of the program

|size=

Just type in a brief description of the program size

|libraries=

Just type in a brief description of what libraries are required to run the program

|compatibility=

Enter the calculators compatible with a syntax similar to the example used for all calculators: TI-83/84/+/SE

|author=

Enter the name of the author of the program

|download=

Type in the URL to the program in accordance with the wiki syntax, and any other details if required

A | B | D | E | I | L | M | N | O | R | S | T | U | V | W | Z

In the Error Conditions section on a command page, descriptions will be given of the errors that can result when using a command. These do not include errors that can occur with virtually any command, such as ERR:ARGUMENT or ERR:SYNTAX. However, if one of these errors is triggered in an unusual way, it will be listed.

Be aware that certain errors don't occur when graphing or using one of the commands DrawF, DrawInv, Tangent(, or Shade(. Instead, the graph point is skipped and treated as an undefined value. Tangent( is a minor exception, actually: if there's an error at the tangent point, it will be treated normally. The errors that are ignored in graphs are:

There are are also several error messages that don't actually occur (as far as anyone knows) from normal use of the calculator — however, the messages are stored in the OS along with the normal messages. It's conceivable that an assembly program, especially an official TI application, would use these error messages for its own purposes. These messages are ERR:SOLVER, ERR:SCALE, ERR:NO MODE, ERR:LENGTH, and ERR:APPLICATION.

A

ARCHIVED

  • You have attempted to use, edit, or delete an archived variable. For example, dim(L1) is an error if L1 is archived.
  • Use UnArchive variable name to unarchive the variable before using it. For lists, SetUpEditor is recommended instead since it does the same thing, but works on the TI-83 (which has no archive) as well, and does not crash when the list is undefined.
  • There is no way to archive or unarchive programs using pure Basic, although several assembly utilities are available for doing so.
  • When you attempt to edit a archived Matrix,List,Variable, or program, the option 2:GOTO doesn't show up.
  • Use Unarchive or the memory manager to unarchive a variable,matrix,list, program, etc.

ARCHIVE FULL

  • You have attempted to archive a variable and there is not enough space in archive to receive it.
  • Sometimes, if the calculator displays a message from memory management saying "Garbage Collect?", choosing the option No gives this error.

ARGUMENT

  • A function or instruction does not have the correct number of arguments. See the appropriate command page.
  • A function or instruction that can have any number of arguments has 256 or more.
  • In general, if a function has more than one non-SYNTAX error in it, this is the error that will be generated first (if it applies, of course).
  • Generally, on graphing calculators and such, most functions ex: randInt( require that you use commas to make a list.

B

BAD ADDRESS

  • You have attempted to send or receive an application and an error (e.g., electrical interference) has occurred in the transmission.

BAD GUESS

  • With the solve( function, the equation solver, or an operation from the CALC menu, your guess wasn't within the lower and upper bound, or else the function is undefined at that point. Change the guess.

BOUND

  • In a CALC operation or with Select(, you defined Left Bound > Right Bound.
  • In fMin(, fMax(, solve(, or the equation solver, the lower bound must be less than the upper bound.

BREAK

  • You pressed the [ON] key to break execution of a program, to halt a DRAW instruction, or to stop evaluation of an expression.

D

DATA TYPE

  • You entered a value or variable that is the wrong data type.
  • For a function (including implied multiplication) or an instruction, you entered an argument that is an invalid data type, such as a complex number where a real number is required.
  • In an editor, you entered a type that is not allowed, such as a matrix entered as an element in the stat list editor.
  • You attempted to store an incorrect data type, such as a matrix to a list.
  • You attempted to divide matrices, which should be done by matrix inversion and multiplication instead.
  • This error is not returned when graphing (see the note at the top of the page).

DATE

  • Only on the TI-84+ or TI-84+ SE, this error occurs when an invalid date is entered.
  • Below the error menu, an explanation of what's wrong is given: e.g., "Invalid day for month selected."

DIM MISMATCH

  • You attempted to perform an operation that references more than one list or matrix, but the dimensions do not match.
  • In most cases, the dimensions are required to be equal, with the following exceptions:
    • When multiplying two matrices, the number of columns of the first must match the number of rows of the second.
    • When using augment( to combine two matrices, only the number of rows must match.
    • With the List►matr( command, the lists don't have to match sizes - shorter lists will be padded with zeroes.

DIVIDE BY 0

  • You attempted to divide by zero.
  • You attempted a linear regression on data that fit a vertical line.
  • This error is not returned when graphing (see the note at the top of the page).

DOMAIN

  • You specified an argument to a function or instruction outside the valid range. This error is not returned during graphing. The TI-83+ allows for undefined values on a graph.
  • You attempted a logarithmic or power regression with a negative X or an exponential or power regression with a negative Y.
  • You attempted to compute ΣPrn( or ΣInt( with pmt2 < pmt1.
  • You've assigned a value to n (the sequential graph variable), nMin or nMax that isn't an integer, or that is less than 0.
  • This error is not returned when graphing (see the note at the top of the page).

DUPLICATE

  • You attempted to create a duplicate group name.
  • You attempted to create a duplicate program using AsmComp(.

Duplicate Name

  • A variable you attempted to transmit cannot be transmitted because a variable with that name already exists in the receiving unit.
  • Also appears when you unpack a group and a variable in the group is already defined. In both cases, it will give you several options for correcting the error, including Omit, Rename, and Overwrite.

E

EXPIRED

  • You have attempted to run a Flash application with a limited trial period which has expired.

Error in Xmit

  • The TI-83+ was unable to transmit an item. Check to see that the cable is firmly connected to both units and that the receiving unit is in receive mode.
  • You pressed [ON] to break during transmission.
  • You attempted to perform a backup from a TI-82 to a TI-83+.
  • You attempted to transfer data (other than L1 through L6) from a TI-83+ to a TI-82.
  • You attempted to transfer L1 through L6 from a TI-83+ to a TI-82 without using 5:Lists to TI-82 on the LINK SEND menu.
  • You attempted to use SendOS with no other calculator connected.
  • When this error occurs, the option 2:Goto doesn't show up, but will redirect you to the LINK screen instead of the main screen.

I

ID NOT FOUND

  • This error occurs when the SendID command is executed, but the proper calculator ID cannot be found.
  • When this error occurs, the option 2:Goto does not show up.

ILLEGAL NEST

  • You attempted to use an invalid function in an argument to a function.
  • This happens when using seq( in the expression for seq(, fnInt( within the first argument of fnInt(, expr( inside the string argument of expr(, or Σ( within the argument for Σ(.

INCREMENT

  • The increment in seq( is 0 or has the wrong sign.
  • The increment in a For( loop is 0.
  • This error is not returned when graphing (see the note at the top of the page).

INVALID

  • You attempted to reference a variable or use a function where it is not valid. For example, Yn cannot reference Y, Xmin, ΔX, or TblStart.
  • You attempted to reference a variable or function that was transferred from the TI-82 and is not valid for the TI-83+. For example, you may have transferred UnN1 to the TI-83+ from the TI-82 and then tried to reference it.
  • In Seq mode, you attempted to graph a phase plot (uvAxes, uwAxes, or vwAxes) without defining both equations of the phase plot.
  • In Seq mode, you attempted to graph a recursive sequence without having input the correct number of initial conditions.
  • In Seq mode, you attempted to reference terms other than (n-1) or (n-2).
  • You attempted to designate a graph style that is invalid within the current graph mode.
  • You attempted to use Select( without having selected (turned on) at least one xyLine or scatter plot.
  • You attempted to use certain functions (e.g. If, Then, Else) outside a program.

INVALID DIM

  • You tried to access an element past the end of a list or matrix (there is an exception: it's allowed to store to the element one past the end of a list, adding the element).
  • You specified dimensions for an argument that are not appropriate for the operation.
  • You specified a list dimension as something other than an integer between 1 and 999.
  • You specified a matrix dimension as something other than an integer between 1 and 99.
  • You attempted to invert a matrix that is not square.

ITERATIONS

  • The solve( function or the equation solver has exceeded the maximum number of permitted iterations. Examine a graph of the function. If the equation has a solution, change the bounds, or the initial guess, or both.
  • irr( has exceeded the maximum number of permitted iterations.
  • When computing I%, the maximum number of iterations was exceeded.

L

LABEL

  • The label in the Goto instruction is not defined with a Lbl instruction in the program.
  • When this error occurs, the option 2:Goto doesn't show up.

M

MEMORY

  • Memory is insufficient to perform the instruction or function. You must delete items from memory before executing the instruction or function.
  • You might also want to try archiving some variables,matrixes,lists,etc if you have nothing in RAM that you don't need.
  • Recursive problems return this error; for example, graphing the equation Y1=Y1. (but Y1=X, Y2=Y1, for example, will NOT cause an error.)
  • Branching out of an If:Then, For(, While, or Repeat loop with a Goto will waste memory until the program finishes running, because the End statement that terminates the loop is never reached. Unless a program is very large, this is one of the likeliest causes of ERR:MEMORY. Refer to memory-leaks.

MemoryFull

  • You are unable to transmit an item because the receiving unit’s available memory is insufficient. You may skip the item or exit receive mode.
  • During a memory backup, the receiving unit’s available memory is insufficient to receive all items in the sending unit’s memory. A message indicates the number of bytes the sending unit must delete to do the memory backup. Delete items and try again.
  • You may also try to archive some variables to free up some memory that you do not plan to transmit.

MODE

  • You attempted to store to a window variable in another graphing mode or to perform an instruction while in the wrong mode; for example, DrawInv in a graphing mode other than Func.

N

NO SIGN CHNG

  • The solve( function or the equation solver did not detect a sign change.
  • You attempted to compute I% when FV, (N*PMT), and PV all share the same sign.
  • You attempted to compute irr( when CFList and CFO share the same sign.

NONREAL ANS

  • In Real mode, the result of a calculation yielded a complex result.
  • This error is not returned when graphing (see the note at the top of the page).
  • This error can appear if you use a negative number for some operations, such as ln

O

OVERFLOW

  • You attempted to enter, or you have calculated, a number that is beyond the range of the calculator (-1E100 to 1E100, non-inclusive).
  • Sometimes you can fix this error by re-ordering operations. For example, 60!*30!/20! will return an overflow error, but 60!/20!*30! will not.
  • This error is not returned when graphing (see the note at the top of the page).

R

RESERVED

S

SINGULAR MAT

  • A singular matrix (determinant = 0) is not valid as the argument for -1.
  • A regression generated a singular matrix (determinant = 0) because it could not find a solution, or a solution does not exist.
  • This error is not returned when graphing (see the note at the top of the page).

SINGULARTY

  • The expression in the solve( function or the equation solver contains a singularity (a point at which the function is not defined). Examine a graph of the function. If the equation has a solution, change the bounds or the initial guess or both.
  • Although the correct spelling is "singularity", the error message shown has "singularty" on all calculators and OS versions.

STAT

  • You attempted a stat calculation with lists that are not appropriate.
  • Statistical analyses must have at least two data points.
  • Med-Med must have at least three points in each partition.
  • When you use a frequency list, its elements must be at least 0.
  • (Xmax - Xmin) / Xscl must equal 47 for a histogram.

STAT PLOT

  • You attempted to display a graph when a stat plot that uses an undefined list is turned on.
  • To fix this error, use the command PlotsOff to turn off plots when you're using the graph screen.

SYNTAX

  • The command contains a syntax error. Look for misplaced functions, arguments, parentheses, or commas. See the appropriate command page.
  • This error will also occur in place of a DATA TYPE error if the variable type in question is a variable name (with seq(, solve(, For(, and other commands)
  • The command was attempting to get expr( of a non-value string, i.e., trying to evaluate a space, equals sign, etc.

T

TOL NOT MET

  • You requested a tolerance to which the algorithm cannot return an accurate result.

U

UNDEFINED

  • You referenced a variable that is not currently defined. This error doesn't occur with number variables (A-Z,θ), which have a default value of 0.
  • Lists, matrices,strings,pictures, and GDBs have to be stored to first, in order to be used.
  • Most system variables always have a value, so this error doesn't apply to them.
  • However, statistical variables are undefined except for those used by the last relevant command.
  • Undefined equation variables (such as Parametric and Polar variables) return ERR:INVALID instead of ERR:UNDEFINED.

V

VALIDATION

  • Electrical interference caused a link to fail or this calculator is not authorized to run the application.

VARIABLE

  • You have tried to archive a variable that cannot be archived or you have have tried to unarchive an application or group.
  • Variables that cannot be archived include:
    • The number variables R, T, X, Y, and θ (because they are used for graphing)
    • The list ∟RESID (because it's reserved for residuals from regression models)
    • System variables (including statistical variables, finance variables, equations, plots, and window variables)
    • The AppIdList.

VERSION

  • You have attempted to receive an incompatible variable version from another calculator.

W

WINDOW RANGE

  • A problem exists with the window variables.
    • You defined Xmin>Xmax or Ymin>Ymax.
    • Xmin and Xmax (or Ymin and Ymax) are equal or so close that numerical precision can't allow for enough values between them.
    • The values for θmin, θmax, and θstep create an empty or never-ending loop for θ.
    • The values for Tmin, Tmax, and Tstep create an empty or never-ending loop for T.
  • When this error occurs, the option 2:Goto doesn't show up.

Z

ZOOM

  • A point or a line, instead of a box, is defined in ZBox.
  • A ZOOM operation returned a math error.
  • When this error occurs, the option 2:Goto doesn't show up.

Other

?

  • An unknown error has occurred.

This page is a guide to the template pages.

{$picture}

Command Summary

{$summary}

Command Syntax

{$syntax}

Menu Location

{$location}

Calculator Compatibility

This command requires a calculator with Flash memory (that is, it will not work on a TI-92).
Calculator Compatibility

This command requires a calculator with AMS version 2.{$ams2xx} or higher (it will also work on any TI-89 Titanium or Voyage 200 calculator)
Calculator Compatibility

This command requires a TI-89 Titanium or Voyage 200 calculator with AMS version 3.{$ams3xx} or higher.

Token Size

{$size}

toolbar-separator.png This article is currently in development. You can help TI-Basic Developer by expanding it. I will get around to finishing this, probably during the Summer Holidays. ~ James Kanjo

Multiplayer is where two or more people play a game together at the same time. Although you can create AI opponents for a player to play against, AI does not offer as much fun compared to playing against other human opponents — you can have the players work together, compete against each other, and even one player manage the other players.

Multiplayer games are generally divided into two categories: the players share a single calculator, and the players each play on their own calculator connected together with a link cable (either I/O or USB).

Single-Calculator Multiplayer

Multiplayer games on one calculator generally fall into two categories: real-time and turn-based. Real-time is where the game action is constantly changing, not stopping for the player input. Some classic examples of real-time games are Galaxian and Pong. Turn-based is where each player is allowed to make a move, and the game action only changes after each player has moved. Some classic examples of turn-based games are Battleship and Scorched Earth.

Making real-time games involves using the getKey command, except you can't wait for a key to be pressed. The general form is something along the lines of:

While <game not done>
getKey->K
If K=<player 1 key>:Then
// player 1 action
End
If K=<player 2 key>:Then
// player 2 action
End
<Update rest of game>
End

As you can see, the player action only occurs when a player has pressed a particular key; otherwise the game just continues on like regular, with the main game loop being repeated over and over again.

There are some problems with making real-time games, however.

The first, and foremost, problem is that TI-Basic is rather slow with user input. If you do anything remotely time-intensive, such as displaying lots of graphics or complex variable manipulation, then there will be some lag-time between when a player presses a key and when the calculator gets around to processing it. Although there's not really much you can do about this, you can make sure your game is as optimized as possible (especially breaking the more time-intensive parts into their own subprograms).

The second problem is that the calculator only keeps track of the last key pressed since the last time getKey was executed, so that means only one player can have their input read and processed each time through the game loop. In addition, if you enter a large block of code for the player, it will take a while before the other players have a chance to do anything.

Related to the second problem, the third problem with making real-time games is that unlike the other keys, the arrow and DEL keys can actually be held down, which will cause them to keep being repeated until they are unpressed. The effectively disables the other keys from being able to be pressed. There is no viable way to get around this problem, except asking the players to not press those keys.

The fourth problem is that the keypad is quite small, and having two or more people try to share the calculator can be rather difficult. The best way to work around this problem is choosing keys for each player that are a good distance away from each other. When choosing keys you should also keep in mind the calculator screen — if somebody has to press keys that make it difficult to see the screen, then you should choose different keys.

Because making real-time games is not very practical, a better alternative is turn-based games: you hand the calculator from player to player, allowing each each player to move one at a time. These games are much easier to program: you simply use a variable to keep track of whose turn it is, increment the variable after each player's turn, and when everybody has completed their turn, you reset the variable. The only real downfall of turn-based games is that they can be slow because you have to wait until the other players are done before you can move.

Multi-Calculator Multiplayer

So I guess you're wondering how to program a multi-calculator multiplayer experience into one of your games. One of the first things you will need to do is familiarize yourself with the GetCalc( command. Basically, it retrieves a specified variable from another calculator and stores it to that variable on yours.

Creating multiplayer programs over two calculators is a much less simple process as it is to make single-calculator multiplayer programs. However, doing so could be the main selling point of your program and would certainly be worth the effort. You will notice that in each of our examples we tend to transfer lists, which we recommend you do too. Whilst it is possible to transfer a variety of real variables, it is much faster to transfer a list of numbers than a number of real variables.

There are two general ways to programming multi-calculator programs; one screen processing and two screen processing. The one screen processing method is simply making a program use the statistics from another calculator, and the whole multiplayer experience is processed on that calculator. The two screen processing method is much more complex, where we can share the multiplayer processing across two calculators by using a "turn-by-turn" interface.

Core

When it comes to multi-calculator multiplayer games, it is absolutely necessary to give each calculator its own identity. As both calculators are running the exact same program, we need a way to be able to determine one calculator as "Calculator A" and the other calculator as "Calculator B". This makes it possible for both calculators to know what data to send and receive. For example, if both calculators were "Calculator A", then both calculators would be doing exactly the same thing, or keep trying to receive the same variable from each other in an endless loop

This is code determines which assigns each calculator with a unique identity:

:GetCalc(A
:e(A=π)+π(A≠π→A

How it works is that the calculator gets the variable A from the other calculator, and checks whether it equals π (pi). If A equals π, then e is stored to A; however, if A does not equal π, then π is stored to A. Here is a table to demonstrate the results:

Calculator A Calculator B
A = π A = e
A = 3.141592654 A = 2.718281828

The calculator can therefore identify itself like this:

:If A=π:Disp "I'M CALC A
:If A=e:Disp "I'M CALC B

If we use a not( routine to make Calculator A = 1 and Calculator B = 0 instead, then we are unable to determine whether a link has been initiated. Simply explained, because variable A is more likely to equal zero than any other number, Calculator A may accidentally assume Calculator B has initiated the multi-calculator sequence. Variable A is not likely to ever equal π (or e), which is why it's useful as a "connection initiated" checker for the calculator.

The beauty of the core code is that it doesn't matter which player executes the core code first, both calculators will be able to give themselves a unique identity, be able to distinguish which calculator they are and be able to see whether the other calculator is initiated yet.

One Screen

If you are looking to save space and valuable time, this is the multiplayer for you. This method has the sending calculator in a power-saving state the whole time while the receiving calculator does all of the hard work such as processing and animation.

First off, we put in the core multiplayer code to determine which calculator is which. Then, Calculator B will retrieve the opponent's statistics for battling. Because the program uses the same variables on every calculator, we need to find a way to store Calculator A's statistics onto Calculator B without overwriting Calculator B's statistics. Surprisingly, this is not as hard as it seems:

:GetCalc(A
:e(A=π)+π(A≠π→A
:If A=π:Then
:∟STATS→L₁
:Disp "SENDING DATA...","PRESS ENTER WHEN
:Pause "FINISHED
:End

Now that each calculator has created its unique identity, and Calculator A has stored its statistics to L₁, we can finally make Calculator B receive Calculator A's statistics and process all of the data:

:If A=e:Then
:GetCalc(L₁
<interactive code>
:End

After this, write the rest as though this was a single-calculator multiplayer game, where you're statistics are in ∟STATS and your opponent's statistics are in L₁. Here is a side-by-side comparison on how the program runs:

Calculator A Calculator B
1SCREEN-A.gif 1SCREEN-B.gif

Two Screens

Here we show you a turn by turn based method of a battle game.

Like with all multi-calculator multiplayer programs, we first provide the program with the core. This time, however, we will first reset variables A and F. Then we will add code for which stores each calculator's statistical data to its individually named list. Calculator B is then instructed to go elsewhere in the program (note that Goto is within an If-Then loop):

:DelVarADelVar FGetCalc(A
:e(A=π)+π(A≠π→A
:If A=π:Then
:∟STATS→L₁
:Else
:∟STATS→L₂
:Goto W
:End

Because this is turn by turn battle game, we need to repeat the battle code until the battle is finished. We will make variable F determine this. Also, we want Calculator A to be able to attack first, so we shall put the code for attacking as the first thing in the Repeat loop. This is where it starts to get a bit sticky. First we delete variable B, which is going to determine what command the user has chosen (whether it be a kind of attack, or to run away).

:Repeat F
:DelVar BMenu("CHOOSE ATTACK","ATTACK A",A,"ATTACK B",B,"RUN AWAY",R
:Lbl A:1→B:Goto S
:Lbl B:2→B:Goto S
:Lbl R:‾1→B
:Lbl S:1→θ

So when the user selects an option from the menu, a number is stored to B and 1 is stored to θ. Theta tells the receiving calculator that it the sending calculator is not ready yet. Then we create a second menu. This is to give the receiving calculator a chance to receive certain variables. That process is almost instant, and so the user then presses ENTER. θ is erased and 1 is stored to S, just before the "animation" program starts. S simply tells the animation program that it has just sent the attack.

:Menu("SENDING ATTACK","READY?",SA
:Lbl SA:1→S
:DelVar θprgmθANIMAT

The animation program is shared by both the attacker and the attacked. The program makes particular animation depending on whether variable S is equal to one. If S=1, then this program will only display the opponent getting hurt. If S=0, then this program will display YOU getting hurt, calculate how much HP you have left, and if you died, sets variable F to zero. By using the subprogram "prgmθANIMAT", it means we don't need to worry about memory leaks or program changes.

Now we have the receiving code. You will notice that Lbl W is the first line here. This is so that Calculator B can jump straight here on the first move. Because this label is within a repeat loop, and the Goto came from an If-Then section, there are no memory leaks. The first thing we do is make the program wait until the sending calculator has issued a move. If the game is over (F=1), then this process stops, and the program exits the "Repeat F" loop. If the game is not over, and the opponent issued a move, then the calculator receives the opponent's updated statistics.

:Lbl W:Disp "WAITING...
:DelVar BRepeat B or F
:GetCalc(B
:GetCalc(F
:End
:If not(F:Then
:If A=e:GetCalc(L₁
:If A=π:GetCalc(L₂

At the moment upon entering the loop, we know that the opponent's θ equals 1. In this loop, we clear our θ variable and then retrieve the opponent's θ. Because of the nature of GetCalc(, we can not receive variables whilst the other calculator is processing. Remember that as soon as the other calculator exits the "SENDING ATTACK…" menu, the animation subprogram starts.

Using this knowledge, if we delete θ and then retrieve θ whilst the opponent is in the "SENDING ATTACK…" menu, θ will equal 1 (and hence the loop is repeated). But when the opponent starts the animation process, we will be unable to retrieve θ, and so θ will equal what it all ready was, zero (hence we exit the loop).

:Repeat not(θ
:DelVar θGetCalc(θ
:End
:DelVar SprgmθANIMAT
:End
:End

This code is rather remarkable because it makes it possible to start the animation on both calculators, at the same time, automatically. You don't need to go messing about with "both users press ENTER at the same time" routines, only one user needs to press ENTER and both calculators begin — a foolproof technique.

If, after the animation process, the battle is not yet over, then the program continues into attack mode again (at the start of the "Repeat F" loop).

Now we need a routine which restores the statistics to the ∟STATS list and says who won after the battle is over! This is the easiest part of the routine. If the player's health points do not equal zero, then that player won — otherwise the other player won.

:L₁
:If A=e:L₂
:Ans→∟STATS
:If Ans(6:Then
:Pause "YOU WON!
:Else
:Pause "YOU LOST!
:End

There are a couple of things that you need to be aware of for this routine to be work:

  1. When the "SENDING ATTACK" menu pops up, you must wait for a second for the attack to actually send before pressing ENTER;
  2. Variable A must NEVER equal π during the program, (obviously with the except of the multi-calculator code itself). If it does, and a different calculator starts this routine before the other one, then the link process will fail.

To prevent the second problem from ever happening, you should reset variable A at the start of your program, and never use this variable throughout the program.

This whole routine is certainly complex, but it does work, and works pretty well too. Here is a side-by-side comparison of how the program runs. For reference, here is a table showing the values:

Calculator A Calculator B
Max HP ∟STATS(1)=2 ∟STATS(1)=5
Level ∟STATS(2)=2 ∟STATS(2)=5
Attack ∟STATS(3)=2 ∟STATS(3)=5
Defence ∟STATS(4)=2 ∟STATS(4)=5
HP ∟STATS(6)=2 ∟STATS(6)=5
Calculator A Calculator B
1SCREEN-A.gif 1SCREEN-B.gif

Final Notes

Whilst the abilities of the GetCalc( command make it harder to create multi-calculator programs, it certainly is not impossible. You just need to think extra hard and create very clever workarounds to its boundaries.

If you have any questions or comments about these routines please ask in the discussion area for this page.

References

  • James Kanjo came up with the "Multi-Calculator Core" code in his IM program, and also came up with the "turn by turn battle" code, including the function to make one calculator respond to another calculator's ENTER keypress
Forum 101
Category nameThreadsPostsLast post
1969by BattlesquidBattlesquid
23 Apr 2018 03:10Jump!
Introduce yourself to the community
2201168by Bio_Hazard1282Bio_Hazard1282
15 May 2018 14:08Jump!
Questions and commentary about the site
1932073by BattlesquidBattlesquid
23 May 2018 05:33Jump!
Questions about certain wiki pages
9483932by Michael2_3BMichael2_3B
20 May 2018 04:12Jump!
General Discussion
Category nameThreadsPostsLast post
You can talk about anything
3442478by absoluteAquarianabsoluteAquarian
17 May 2018 05:19Jump!
Post a funny picture or joke
35346by Bio_Hazard1282Bio_Hazard1282
22 May 2018 14:11Jump!
Arguments and rants welcome
10225by KydapootKydapoot
26 Mar 2016 19:46Jump!
Get help with your technology questions
2781960by TrenlyTrenly
21 May 2018 20:37Jump!
Programming & Design
Category nameThreadsPostsLast post
Discuss TI-83/84 topics
159913010by Michael2_3BMichael2_3B
21 May 2018 18:52Jump!
Discuss 68k topics
93504by Michael C GillMichael C Gill
07 May 2018 15:05Jump!
Discuss TI-Nspire topics
201894by TrenlyTrenly
26 Feb 2018 03:12Jump!
Discuss Assembly topics
1771244by absoluteAquarianabsoluteAquarian
15 May 2018 15:38Jump!
Discuss computers and web development
74508by Thel 'Vadamee (guest)
17 May 2017 20:38Jump!
Projects & Contests
Category nameThreadsPostsLast post
Share your projects
1732095by absoluteAquarianabsoluteAquarian
18 May 2018 04:01Jump!
Share your project ideas
80962by master_programmermaster_programmer
09 May 2018 20:51Jump!
Seeing who can create the best program...
651191by BigBoi1234BigBoi1234
01 Mar 2018 06:20Jump!
Test your command knowledge
4468by TrenlyTrenly
09 May 2018 23:17Jump!
Test your optimization prowess
40485by jonbushjonbush
31 Jan 2018 20:41Jump!
Try to stump others
11522by TrenlyTrenly
04 Sep 2017 00:43Jump!

Show hidden

rss icon RSS: New threads | New posts

toolbar-separator.png This article is part of the coding stage of the development cycle.

Code conventions are a set of guidelines for writing programs, primarily focusing on the structure and appearance of the code. Although code conventions are generally subjective and informal, just the individual preferences of each programmer developed over time, there are several common conventions that most programmers follow and are considered to constitute good programming practice.

Following code conventions not only makes your code consistent, helping to make it easier to read and understand, but also eliminates a lot of the difficulty in maintaining it. Code conventions are also important in group projects, where multiple people are working together and everybody needs to be on the same page.

Naming

The general convention for naming programs, subprograms, labels, and custom lists is to choose a name that tells you what it is (in the case of programs and subprograms) or that relates to how it is used (in the case of labels and lists).

For example, if your program is a Minesweeper clone, then a good program name is something like MINES. If your MINES program has a subprogram, start it with θ or Z so that it appears at the bottom of the program list.

If you have a highscore function built-in to your game, then you should use a custom list that is related to your program's name (i.e., LMINE would make sense for the MINES game mentioned above).

In the case of a label name, you should make it mnemonic — Lbl UP would be an appropriate choice for the code that moves the screen up.

Formatting

The general convention for formatting code is to place related statements together on the same line. This is most applicable with variable declarations, If-Then conditionals, and short loops, although you can certainly put whatever statements that you want.

The way you get multiple statements on the same line is by separating each one with a colon, which is also used to denote the beginning of each new line. The program editor on the calculator allows sixteen characters per line, so if the statements are wider than that, they will cause the line to wrap around to the next line (and however many more lines are needed).

Structure

The general convention for structuring code is to use a loop, except for those situations where using a loop is impractical; in those cases, using a Goto is the preferred convention.

When deciding which loop to use, you need to look at what its functionality will be. If you want the loop to be executed a set number of times, then you should use a For( loop. If you want the code inside of the loop to be executed at least once, then you should use a Repeat loop.

The While loop is very similar to the Repeat loop, so the way to decide when to use either one is by thinking of the loop condition. If the loop is going to keep running as long as the condition is true, then you should use a While loop. If the loop is going to run until the condition is true, then you should use a Repeat loop.

Variables

The general convention for using variables is to use the most appropriate variable whenever possible. There are several different kinds of variables available, including reals, lists, matrices, and strings, and they each have their own time and place.

Reals are used for keeping track of one value, and because they are both small and fast, you should use them before using other variables. Lists are used for keeping track of multiple values, and because they can be created, you should use them for saving highscores and other important data.

Matrices are used for keeping track of two-dimensional values, which means you should use them for making maps on the screen. Strings are used for keeping track of characters, which means you should use them when you want to display text on the screen.

Sample Program

The following sample program is a modified form of the program on the movement page. The main things you should notice are the real variables grouped together on the first line and the use of the Repeat loops for the code structure.

PROGRAM:MOVEMENT
:4→A:8→B
:Repeat K=105
:Output(A,Ans,"X
:Repeat Ans:getKey→K:End
:Output(A,B," "
:A+(Ans=34)-(Ans=25
:Ans+8(not(Ans)-(Ans=9→A
:B+(K=26)-(K=24
:Ans+16(not(Ans)-(Ans=17→B
:End
<< Program Setup Overview Techniques >>

[[include inc:command
|picture=@@
|summary=@@
|syntax=@@
|location=@@
|compatibility=@@
|size=@@
]]

|picture=

If the image is embedded on the same page, then only the full name of the image is to be written here. Otherwise, simply paste the full URL of the image.

|summary=

Just type in a brief description of the command

|syntax=

Enter the general syntax of the command

|location=

Give step by step instructions of how to paste the command into the program. Separate each step with a new line, beginning each line with a # and a space following it. For example:
# Step One
# Step Two

|compatibility=

Enter the calculators compatible with a syntax similar to the example used for all calculators: TI-83/84/+/SE

|size=

Just enter the number of bytes the token takes up, and the word byte or bytes. For example, |size=1 byte or |size=2 bytes

[[include inc:68k-command
|picture=@@
|summary=@@
|syntax=@@

|size=@@ |hex=@@
]]

In general, omitting all the variables for a section is the way to go if you don't want the section to be displayed. The exception is "calculator compatibility" - omitting the variables for that section will display the default message (compatible with all calculators).

|picture=

If the image is embedded on the same page, then only the full name of the image is to be written here. Otherwise, simply paste the full URL of the image.

|summary=

Just type in a brief description of the command.

|syntax=

Enter the general syntax of the command.

Menu Location

This section depends on the type of menu location:

Simple key press

|simplekey=(key)
|command=(command)

Key press varies across models
|ti89key=(key on TI-89 or TI-89 Titanium)
|ti92key=(key on TI-92, TI-92+, or Voyage 200)
|command=(command)

Popup menu
|popuptitle1=(popup menu title)
|popupkey1=(the key for that menu)
|popuptitle2=(submenu title - OPTIONAL)
|popupkey2=(key for that submenu - OPTIONAL)
|popuptitle3=(sub-submenu title - EVEN MORE OPTIONAL)
|popupkey3=(key for that sub-submen - ALSO OPTIONAL)
|laststepkey=(key to finally paste the command)
|command=(command)

Toolbar menu
|toolbar=(toolbar name: program editor, home screen, or graph screen)
|tooloption=(toolbar option name - e.g. F2 - I/O)
|toolmenu=(toolbar submenu - OPTIONAL)
|toolmenukey=(key for the submenu - OPTIONAL)
|laststepkey=(key to paste the command)
|command=(command)

Compatibility

If the command works on all calculators, nothing needs to be done. Otherwise add one of the following:

  • |flashrom=1 if the command requires Flash ROM
  • |ams2xx=yy if the command requires AMS version 2.yy
  • |ams3xx=yy if the command requires AMS version 3.yy (on a TI-89 Titanium, or Voyage 200)

Only one option can be applied (and they are exclusive of each other), otherwise unpredictable results may occur.

Size

If you wish to include the token size section, you need to make the size tag equal to the number of bytes it takes up, plus the word "byte" (or "bytes" if it takes up more than one byte). For example, |size=1 byte or |size=3 bytes

To enter details of token size, specify the hex code for the command itself (hex=0x##) as well as any of the tags that apply to that command: |EXT_INSTR_TAG=1, |EXT_CMD_TAG=1, and |END_TAG=1 for the respective tags.

{$picture}

Program Summary

{$summary}

Program Size

{$size}

Uses Libraries?

{$libraries}

Calculator Compatibility

{$compatibility}

Author

{$author}

Download

{$download}

{$picture}

Routine Summary

{$summary}

Inputs

{$input}

Outputs

{$output}

Variables Used

{$variable}

Calculator Compatibility

{$compatibility}

Author

{$author}

Authors

{$authors}

URL: [{$url}]

Download

[{$download}]

Welcome to the TI|BD Sandbox! A Sandbox is basically a place where you can trial pages/features/whatevers to see whether they will work, before you actually release it to its appropriate section on the site.

Start a new page:

All pages currently under the "Sandbox" category:

The ListPages module does not work recursively.
{$picture}

Command Summary

{$summary}

Command Syntax

{$syntax}

Menu Location

{$location}

Calculator Compatibility

{$compatibility}

Token Size

{$size}

This page includes all pages within the "SK" category.

The ListPages module does not work recursively.

This page includes all pages within the "Nav" category.

The ListPages module does not work recursively.

This page includes all pages within the "Forum" category.

The ListPages module does not work recursively.

This page includes all pages within the "Admin" category.

The ListPages module does not work recursively.

This page includes all pages within the "System" category.

The ListPages module does not work recursively.

This page includes all pages under the "Template" category.

The ListPages module does not work recursively.

This is the page with a list of deleted pages.

The ListPages module does not work recursively.

This page contains a list of all pages withing the "inc:" template. See the GUI version here.

The ListPages module does not work recursively.

krazyness suggested that it would be a good idea to implement a site logo, to replace the current header of the TI|BD wiki. He took the liberty to design and produce the logo. There was much discussions relating to the design of site logo (which can be found here) which led to modifications and new versions, each an improvement from the last. The people who have actually produced the possible logos for the wiki are krazyness, James Kanjo, DarkerLine, and Battlesquid.

Original Header:

This was the original header which krazyness set out to replace.

Logo00.PNG

Version 1:

krazyness
Produced the original logo design for the site (his own design).

Logo01.PNG

Version 2:

krazyness
Manipulated the first version to render the letters "A" in "Basic" and "V" in "Developer" in a higher quality.

Logo02.PNG

Version 3:

krazyness
Rendered the image based on the colours of the wiki, #172028 and #E7E9DC.

Logo03.PNG

Versions 4-9:

James Kanjo
Uses 'very sophisticated photo editing software' (MS Word) to improve the image quality of the logo. Shrunk the height to 63 pixels, because he misread the discussion on the logo, and thought it said to be 63 pixels high instead of 67 pixels high:

Logo04.PNG

Variation with the text gradient dark at the bottom and light at the top:

Logo05.PNG

Variation with different colours which are relative to the site:

Logo06.PNG

Changed the lighting and shadows of version 5. Changed the height of the image to 68 pixels, as that was thought to be the necessary height of the image to fit properly. Added a gradient in the background which fades to the colour #172028 over a length of 32 pixels:

Logo07.PNG

Changed the height of version 6 to 68 pixels for the same reason mentioned in version 7. Adjusted lighting. Added a gradient in the background which fades to the colour #172028 over a length of 32 pixels:

Logo08.PNG

Modified the gradient in the text of version 8 to focus the light in the middle and darkness on the outsides:

Logo09.PNG

Version 10:

Version 10A:
James Kanjo
Realised that the height of the logo should in fact be 67 pixels in height. Made the text look more 'polished' by making it brighter in the middle of the text. Shrunk the main header text. Added subtitle "The TI-Basic Information Repository". Changed the gradient to fade into the colour #172028 over a length of 200 pixels rather than 32.

Logo10A.PNG

Version 10B:
James Kanjo
Increased the height in pixels to be 69 pixels high, because the browser Internet Explorer showed a pixel row that should have been hidden, and so that there is no black pixel row at the bottom of the logo on forum pages. The difference is negligable to the human eye, but it is definitely noticeable when placed in the header.

Logo10B.PNG

Version 10C:
DarkerLine
First try at making a 68k version of the logo.

Logo10C.PNG

Version 10D:
Battlesquid
An attempt towards creating an Nspire header. Traces of blue are on the logo's letters, so that is yet to be resolved.

Logo10D.PNG

Version 10E:

Battlesquid
Made a successful attempt towards creating an Nspire logo to go with the agreed upon theme.
Logo10E.png

Note: Downloading programs is only necessary if you are looking for programs to use on your calculator. If you are just interested in TI-Basic programming, please skip this page and move on to the Variables page.

Before downloading any programs, you should create a folder to store the programs. Where you decide to store this folder is up to you, but the two most common places are the desktop or hard drive (typically the C: drive). Storing folders on the desktop is very convenient, allowing you to quickly access a program without having to hunt and search for it, but the desktop can easily become cluttered with programs and other files.

Within the folder itself, you should give each program its own folder and also create a downloads folder to contain the .zip files that the programs are contained in when you download them (see below for more information about .zip files). Although you could put each .zip file with its respective program, it is better to separate them in case you want to delete the program folder but still keep the program for later use.

When naming the program folders, you should use the full program name and include the version number of the program. This is important because there might be several similar programs — for example, snake games are a dime a dozen — and there might be more than one version of the program. Having the version number in the program folder name allows you to easily determine if you have the latest version of the program.

What to Download

While there are several calculator sites on the Internet that have programs, the sites with the largest program archives are ticalc.org, calcg.org, and unitedti.org. Each of these websites has many different kinds of programs available, including math, science, utilities, graphics, and games, and you can generally find whatever it is that you are looking for. There is a wide range of quality among the programs, however.

Most programs are hit and miss — you don't know if the program will be any good until you download and try it out. There are some simple indicators that you can use to gauge a program's quality: the number of downloads, the rating (if available), the reviews (if available), and the screenshots (if available). None of these is really foolproof, however, because they can be manipulated by the program author.

Generally speaking, assembly programs are of higher quality than TI-Basic programs. This is due to the fact that assembly programs are programmed in the calculator's own machine language, which is more difficult to learn, but allows for much greater speed and functionality. Consequently, most people programming in assembly are fairly decent programmers, and thus most assembly programs that you will find are good quality.

TI-Basic, on the other hand, is simple enough that almost anybody can make programs using it, so there are lots of programs available; the large sites listed above are literally flooded with TI-Basic programs. This is good if you like variety, but most of the programs are of subpar quality, featuring crappy coding, gameplay, and graphics. If you are looking for quality TI-Basic programs, your best bet is to check out the programs on the showcases page.

Opening a Zip File

When downloading a program, it will typically be packaged inside of a .zip file. A .zip file is used to group one or more individual files together for easier downloading, while compressing them to reduce their size. An average program, for example, includes the main program itself, some subprograms, screenshots of the program, and a readme document describing the program and how to use it.

In order to use the contents of a .zip file, you need to "unzip" it using a zip utility program. There are several different zip utility programs available, but which program you are able to use depends on your operating system. The most popular zip program for Windows is WinZip, while the most popular zip program for MacOS is StuffIt Expander. After you download a zip program, you need to run the executable (i.e., the .exe file) to install it.

Once you have your zip program installed, you can begin unzipping your programs. This is actually quite simple, and just involves right clicking a .zip file, arrowing down to the zip program that you installed, and clicking on an extract option. There will generally be a few options for where you can extract the .zip file: the same location as the .zip file, to a specific folder, or to anywhere you want. Of course, since you have your programs folder, you should unzip your programs to that folder.

Using a Program

Although there are usually several files inside of a .zip file, calculator files are the only ones that you can actually use and send to your calculator. There are several different calculator file types available, including programs, groups, images, lists, matrices, strings, Flash applications, and even operating systems, but not all of those are available on every calculator.

Each TI calculator has their own set of file extensions that they work with: the pattern that file extensions follow is the first two characters are the calculator, and the third character is the file type. The regular calculators (such as the TI-83) use the calculator number for the first two characters, while the plus calculators (such as the TI-83+) use the first number and a letter. For example, a file extension of .8xp means that the file is for a TI-83+ or TI-84+, and it is a program.

Besides having the calculator files for the program, you should also read through the readme document that came with the .zip file (if there is one). Although most TI-Basic programs do not require any additional programs to run, some do require assembly libraries (such as xLIB). The majority of assembly programs require a shell, such as MirageOS or Ion. You should check to see what requirements the program has, and download the appropriate files.

Once you have all of the required files to use the program, you can send them to your calculator. This requires a TI-Basic editor (either Graph Link or TI Connect) and a calculator-to-computer link cable (either TI-Graph Link or USB Link). If you are using Graph Link, you just open it up, click the Send menu option, select your files, and click Send. Using TI Connect is similar, except you drag and drop the files to the desired location.

If you don't have a calculator-to-computer link cable, another option is to type the files into your calculator manually. You just open a TI-Basic editor (or use SourceCoder), find the program files in the appropriate directory, and then type in the individual commands. Depending on the size of a program, this can take anywhere from a couple minutes to several hours. This option does not work with assembly programs, however, since they are written in machine code and compiled.

<< Computer Setup Table of Contents Variables >>

The game loop is the fundamental structure of most games. It repeats throughout the game, managing all necessary information and user input. Of course, the game loop will be different depending on the type of game. In a shooting game, it might loop continuously, tracking player movement if there is any, and frequently moving enemies and updating scores and such. In a chess game, it might loop once for every turn, waiting for user moves and updating the positions of pieces only when one is moved, or it might loop every second if a timer is implemented. In general, however, it will usually look like this:

while the player has not won:
 update game information (for example, score or turn count)
 accept user action
 update game status (for example, locations of pieces/units/player)
 display relevant information

There are four main types of loops used in programs. There are For( loops, While loops, Repeat loops, and Goto loops. The first three are the most commonly used whereas the Goto not so much. You probably already read about loops in the previous chapter, but this discusses the fundamentals of each loop in detail and displays the application of such things when referring to game building.

While Loops

This loop is the most basic loop. What you do is put a condition after it, and while that condition is true, the loop will continue to run between the While and its End until the condition becomes false. So, when the calculator encounters a While, it tests the condition after it and depending on whether it is true or not, the calculator will either execute the loop or skip it. If it executes the loop, it will continue to do so until the condition after While becomes false. Let us consider this code:

:3→A
:While A<10
:A+1→A
:Disp A+1
:End
:Disp "Finished"

This code, of course, initially stores 3 into A. Then, it encounters the While loop. What the program then does is tests the A<10. If it is 1 (or true), then it will execute the next commands. If it is 0 (or false), then it will skip to the End and continue from there. In this case, 3<10 is true, so it begins the loop by executing the following commands. A increases by 1, and then it displays one more than that value. So, it displays 5, but A is 4. When the program reaches the End, it then tests A<10 again. If it is true, then it will execute the commands again. If it is false, it will continue after the End. So, since 4<10, it will do the loop commands again. So it now displays 6. It will continue to do this until A is equal to or greater than 10. So, once A becomes 10, the program will display "Finished!".

That is the essence of loops: repeating a group of commands while or until a condition becomes true, or when something specific occurs.

While loops are good for elimination games where while player is still alive, his turn commences. If the player is eliminated, then it would skip the loop. Another reason for a While loop is as a sub loop where an action from the user determines the usage of the second loop. If the action doesn't involve the loop, then the loop can be skipped.

Repeat Loops

The Repeat loop is almost the same as the While loop, but there is a difference. First of all, the repeat loop will continue to loop until the condition after it is true. So, if the condition is not true, then it will continue to loop until that condition becomes true. Another difference is that when the calculator encounters a Repeat, it doesn't scan the condition. It will automatically start the loop and test the condition when it reaches the appropriate end. When the calculator reaches a Repeat, it cannot be skipped. Consider the following code:

Note:
The difference between a While loop and a Repeat loop is that the While can be skipped depending on the condition. A Repeat loop is always executed regardless of initial condition.

:15→A
:Repeat A=15
:A=15→A
:Disp A
:A+2→A
:End
:Disp "Finished"

This code firsts stores 15 into A. Now, it begins the loop. Since it is a Repeat loop, the loop is automatically executed even though the condition is true. Since A is 15, the Boolean logic becomes 1 and is stored into A. The first display is 1. The program then adds two to A. When it reaches the End, the loop goes back to the condition and tests it. It will continue through the same cycle until the A becomes 15. When that happens, the program displays "Finished".

Repeat loops are typically used as the main, or base, loop of the program or action. The reason for this is so the loop becomes automatically executed rather than being skipped. Also, the mentality of a game loop is to continue gameplay until the person dies/loses. With this mentality, the condition is easily depicted as the situation when the player loses making the loop end at that instance.

For( Loops

This loop is not like the others, and it is a little more complex. This loop requires 3 arguments with one optional argument. When writing a For( loop, you use this syntax:

For(variable,start,stop,[increment])
If increment is not given, the calculator assumes it is one

What the loop does is it first stores the start number into the variable. Then, it runs through the commands until it reaches End. When End is reached, the calculator loops to the For, adds increment to the variable value, and runs through the commands again. The loop continues to run until stop is reached. When that number is reached, then the calculator will proceed executing commands after the End.

Consider this code:

:For(A,2,6)
:Disp A
:End

This code starts the For( loop by giving A the value of 2. After it displays the two, the program adds one to A and displays again. It continues to add one until it hits 6. When that happens, the program runs through Disp one more time and ends the loop.

This type of loop can become incredibly useful in games. If the user makes an action where multiple things must be accomplished but of similar origin, a For( loop can be used. This loop can also be used when there is a certain number of turns being played. You could set up the loop as For(T,1,10) for a 10 turn game and put the code between the For( and its appropriate End. As you practice with this loop, you will understand exactly how useful it can become.

Goto Loops

This is probably the least common loop used in the TI-Basic community. What you do is you place a Label somewhere and later in the program put a Goto leading to the label for the use of repeating a set of commands. This type of loop requires no arguments or conditions, but it must be exited with some sort of other Goto. Although this is a relatively fast type of loop (if the Label is near the top), the positioning of the Goto could lead to some problems. The problem with goto is the event of Memory Leaks in which the calculator loses memory within the program and eventually terminates due to lack of RAM. This occurs when you have a Goto within a loop or condition that leaps to a label outside of that loop. The calculator uses memory every time it encounters a loop in order to remember that it needs to find an End somewhere. The problem is, when a Goto is used to jump out of the loop, that memory is lost because the calculator never found End. So, although useful in some cases, Goto loops are not recommended for primary game loops.

Goto and Lbl have a different purpose really. They can instead be used to locate various loops for game functionality. If you reach a condition that needs to be jumped backwards to another loop, a Goto Lbl combo can be used to easily jump back to the loop. Although dangerous, these Goto's do have a use, just be careful when placing them within loops.

Infinite Loops

An infinite loop is a loop that continues forever. The most common infinite loop is While 1. Since the condition can never be 0, the loop never ends. These loops in a game are not as useful as a terminating loop, but they can be utilized along with Goto to produce a game with a function that repeats several times regardless of status. Loops like this can be used when the player can't lose, only quit. In such situations, an infinite loop can be used and a Goto can determine when to leave (careful of memory leaks). These loops are typically replaced with a While loop that has a condition for when the player quits, but nonetheless, this loop can be used only sparingly.

Application

So, how can these loops be applied to making a game? Well, for BASIC games, loops are often needed for repetitive or continued tasks. A loop can be put somewhere near the beginning, and that loop can continue to run until the player loses. The main loop is the Repeat loop. It is typically used as the base for games. The conditional used after the loop is typically like this:

:Repeat (player dies/loses) or (getKey value)=45
code code code
:End

This way, when the player loses, the loop ends, or when he clicks Clear, the loop ends. The content of code code code could be anything really, but it typically follows a pattern found in many basic games. The code usually starts with updating the game stats and output. This is used mainly for turn based games as most games will update the information at the end of the code. Then, the program should ask or give opportunity for user input, accept it, and take action upon it. After that, the game should update output and other game stats or allow an AI to activate.

This is a list of the basic game types and what types of loops can be used to accomplish these actions.

Action

An action game is one where the playing field is constantly changing whether the player does something or not, and depending on the input, other things on the field react to the action of the user. These types of games can be quite challenging because of the constant update. The reason is because of the additional coding put under the same loop as the input selection, usually getKey. This slows down the system's ability to accept user input.

So, let's say you wanted to make a game where if X became 0, you lost, or if you hit getKey, the game ended. X is 5 when you win. Also, there are multiple things occurring even if the user takes no action. You can use the following code

:Repeat X=0 or X=5 or Ans=45
:Output(A,B,"_")
:min(8,max(1,A+sum(ΔList(Ans={25,34}))))→A
:min(16,max(1,B+sum(ΔList(K={24,26}))))→B
:Output(A,Ans,"O")
other activity coding
:getKey→K
:End
:ClrHome
:Disp "You"+sub("LoseWin!",4(X=5)+1,4)

So, we are using a Repeat loop with some conditionals after it. The conditionals represent when the game ends: when you lose (X=0), when you win (X=5), and when you quit (press Clear). The program loops through the game until one of the conditions is met. The next thing the program does is update user action info. Depending on which arrow key the player clicked, the program will move in that direction (remember from Movement?). Next, you would put other action after the update, but only put a small amount of coding, or else the least possible. The more code you put in other activity coding, the slower the game will be, and nobody likes a slow game. Finally, the game should ask for user input.

Now, it may seem weird to ask for input at the end, but it is a very useful technique. The reason the input is at the end is to use Ans in the loop conditional which makes the game run a little faster. Anywhere you can get speed makes an action game better, so try to follow this general outline. As you get more experienced, you will begin to find other alternatives to this loop as the type of game changes, but for now, this outline will help you make basic games.

Strategy/Turned Based

A strategy or turn based game is one that waits for the user input before the calculator makes any further action. In this type of game, speed is not normally as important because it is usually a thinking type game. The coding for a strategy game works in a way as described at the beginning of the article. You would need separate scores for each player. If it were an elimination type game, then a While loop can be used within a Repeat loop to indicate player turns. The loop pattern would be sort of like this:

Repeat one player is left
Update player turn by one or reset to one at max
Update player information output
While player is alive or Clear
Ask for input
act upon input
update game info
update output
End
extra stuff
End

This works by repeating the loop until one player is left and updating all player info according to previous outputs. The While loop is used for the player input. However, if the player is eliminated, then the While loop will be skipped. It will then ask for input and update that player's info accordingly.

So, putting this code to action, let us say that you are building a Risk game. You can have a Repeat loop backbone the whole game and use nested While loops for player action. Here is an example (although a rather poor one) for a Risk game where L1 is the board of 42 spaces where iPart is the number of troops and fPart is who is occupying the space, T is the player turn, and K is the getKey.

:Repeat not(variance(10fPart(L₁)))
:T(T≠4)+1→T
show stats
:While max(T=10fPart(L₁)) or K=22
:Repeat Ans
:getKey→K
:End
Update info
Update Output
:End
:End

So, this code has L1 as the whole board. Since the fPart is the occupant of the territory, then when all of the territories have the same occupant, the variance( will be 0, and since not( is used, the equation becomes 1 when the answer is 0. So, the loop ends when all territories are occupied by the same person. The While loop won't even execute if there is not a single square with occupant T. That represents that player being eliminated. So, the loop goes back to the beginning. The turns are updated for every pass, and then T=4, the turn number is set back to 1.

Limited Turns

A game with limited turns ends when a counter reaches a certain number. There are a couple of ways you can do this. You can use a Repeat loop with turn number T. When T, which is updated every loop, reaches a certain number specified in the Repeat conditional, the loop will end. Or, you can use the For( loop. The For( loop automatically updates a variable and ends when the stop is reached. So, you can set up a code like this:

:For(T,1,(last turn))
Output turn number
Update conditions
Secondary loop
Ask for User input
Update action

Pretty much, all you are doing is setting up a turn keeper and using one of the previous loop examples to run the main function of the game. Turn based games is really just an added addition to the other loops.

Conclusion

This wraps up the Game Loop tutorial. This is just the basics of making a game. In making a game, the loop only represents the backbone of the program. What lies within a loop is the meat, and that is what makes the game function. The next section deals with data types which will introduce to you the various ways we can manipulate numbers to accomplish jobs.

<< Movement Table of Contents Data Types (Intro) >>

Once you have been writing programs for a while, you may realize that you can't accomplish everything by entering numbers and strings. In a program such as a game, you often need to accept arbitrary keypresses. That's where getKey comes in.

How It Works

getKey is the 7th entry in I/O under the PRGM menu. It returns a number corresponding to the key pressed by the user.

But if you put it into a program by itself, it doesn't seem to do much - it immediately gives you a "Done". This is because getKey checks for a key only in the fraction of a second when it executes, and then returns a 0 if it doesn't find one. Commonly, it will be inside some kind of loop so that the program doesn't proceed until a key is actually pressed.

:Repeat K
:getKey→K
:End

In this case, getKey is repeatedly stored in K until a key is pressed, at which time getKey returns a positive value, which is accessible in K after the loop exits.

The number returned by getKey is formed from the row and column the key is in on the calculator. The row is from 1 (Y= to GRAPH) to 10 (ON to ENTER), and the column starts from 1 and goes left to right. The arrows left, up, and right are in row 2, and down is in row 3. 101 (ON) is not actually returnable by getKey because pressing ON in a program stops the execution of the program

Uses

Obviously, there are many ways to use key presses in a program. You can let users select a choice without having to enter a number or go through a menu. Or you can let users input a command such as CLEAR. However, be sure to let the user know what each key actually does, for the sake of usability.

Or, in a game, key presses can be used to control a character. For example, the arrow keys move a spaceship, and 2nd fires the laser. In a turn-based game the above loop method is useful, as you can create a loop for the turns and accept a user action on each turn. But in a real-time game you would probably not want to use a loop around getKey, so that the game isn't interrupted by waiting for a key. Instead, you can let the program run continuously and check once for a key once per some (short) interval of time, so user commands are still accepted correctly. For more, see the next section.

The reason this works is that even if the key press doesn't line up with getKey exactly, if a key is pressed while the calculator is doing something by itself (the progress bar is going in the top right corner, for example), it carries over to the next getKey. Alternatively, a held-down key will register on the first getKey while it is being held down, and the arrow keys and Del will continue to register with further getKeys until they are released.

By changing the loop around a getKey, only a certain key can be accepted.

:Repeat K=105
:getKey→K
:End

This will ignore all key presses until 105 (ENTER) is pressed. In this case, it is probably better to use Pause. But in general, getKey is a very useful tool for accepting a wide range of user input.

<< More on the Home Screen Table of Contents Movement >>

Getting Additional Help

Most of the members of this wiki can be found on the forum, so you can post there with questions and get help with whatever you are working on or trying to learn.

In order to post on the forum, however, you need to create an account. This is an easy process, and should take no more than a couple minutes.

It is the goal of this site to eventually cover all information on TI-Basic programming for the TI-83 series of calculators. However, an excess of information can be overwhelming, so this page gives a suggested reading order (as well as necessary tidbits) so you don't get lost.

There are two alternatives for those who have just ventured into programming for these calculators. While you might want to just jump in, we have a tutorial that explains the basics of TI-Basic and another that answers basic TI-Basic questions.

The first, the TI-Basic Starter Kit, teaches TI-Basic without assuming any previous programming experience. In fact, the very first section explains how to create your first program. After reading this tutorial carefully, you should be more than ready to handle the rest of this site.

The second tutorial is the TI-Basic FAQ. As the name suggests, it is an attempt to answer the common TI-Basic questions that people ask. Many of the questions are related to each other, so it is recommended that you read through the whole list. If you have any questions that aren't mentioned on the list, or an answer doesn't help, please leave a post in the forums and somebody will try to help you.

Further Reading

At this point, you should be familiar with more than a few TI-Basic commands. It might be a good idea to just jump into the command index and click on commands that sound interesting — you can really improve your TI-Basic knowledge that way. Or, select a category from the Commands menu in the top navigation, and read about commands in a more general way.

Looking at code examples is also a good way to learn. Games and Programs are a good place to find such example code. See the Routines page for several short routines to get simple things done in the best possible way.

Use the glossary whenever you come across a term you're not familiar with. If it's not there or the entry doesn't help, drop a note in the forums and (usually within a day) helpful people will explain it and hopefully improve the glossary as well, so no one else has the same trouble.

The pages in the Reference section of the top menu are probably not ones you'd read for fun. Take a look at them at any time to see what they're all about, and then check back when you need to know more.

Writing a Program

Of course, the best way to learn these topics is to come up with a project of yourself (check the project-ideas page if you have no ideas), and go through the steps as you're doing it:

  1. Look at Planning when you're thinking about how to approach the problem.
  2. Consider Commenting Code and Code Conventions when you're writing it.
  3. If bugs arise (and they most likely will), see the section on Debugging.
  4. When the program works, add Setup and Cleanup to it, and check the sections on Usability and Portability.
  5. If the program is too slow (and maybe even when it's not), see Optimization and Code Timings for ways to improve it.
  6. Finally, see Releasing Your Program for how to earn TI-Basic programming fame by making the program public.

These are listed in the Design section of the side navigation menu.

Advanced Topics

The Techniques section in the side navigation menu discusses some advanced issues in TI-83 programming. You should probably have a good grasp of programming before venturing into these pages, but they are worth reading. Give them a glance to see how much you can understand.

Each technique is mostly a stand-alone page. Here are the relative difficulties of the pages:

Easy

  • Friendly Windows — makes using the graph screen commands much easier.
  • Piecewise Expressions — very important to programmers.
  • Saving Games — almost as easy as just storing to a variable.
  • Highscores — an extension of saving, using a string for names and a list for scores.
  • Animation — adds some visual pop or pizazz to your programs.

Intermediate

  • Validation — how to ensure user input satisfies your requirements.
  • Making Maps — how you store the contents of the screen to a variable.
  • Movement in Maps — adds user interaction to programs.
  • Custom Text Input — useful when you want to get input on the graph screen.
  • Custom Menus — allows the user to choose among different options.

Hard

  • Graphics — different ways to make graphics and sprites.
  • Compression — if you wanted, you could get into some heavy theory with this.
  • Self-Modifying Code — code that changes itself while it is executing.
  • Subprograms — calling one program from another, including external and internal programs.
  • Assembly — you can make much better programs, but they are larger and more complicated.

Review

  1. What are the advantages of TI-Basic compared to assembly?
  2. Where do you edit programs on the calculator?
  3. What characters are allowed for a program name?
  4. How do you get an ERR:BREAK error?
  5. How do you get the letter variables A through Z?
  6. How do you store a value to a variable?
  7. Describe what input and output are, and give an example of each.
  8. What is the value of this conditional — A/B and C≥D — when A=52, B=3, C=0, and D=2?
  9. How many options are allowed in a Menu( command?
  10. Describe how a For( loop works, and give an example.

Programming

  1. Write a program that displays your name and age centered on the screen, underneath one another.
  2. Modify the STATES program below by adding a couple more options for U.S. states.
  3. Write a program that computes the sum of the first N positive integers, for a user-supplied value of N.
  4. Modify the NUMBERS program below to only display odd numbers.
PROGRAM:STATES
:Menu("U.S. STATES","FL",FL,"NY",NY)
:Lbl FL
:Disp "FL"
:Stop
:Lbl NY
:Disp "NY"
PROGRAM:NUMBERS
:For(X,-20,20)
:Disp X
:For(Y,1,20)
:End
:End
<< Chapter Summary Table of Contents Sample Program: Guessing Game >>
  1. TI-Basic is the built-in programming language on all of TI's graphing calculators.
  2. When making programs, there is a general order that you follow: you create the program, then you edit the program, and finally you execute the program.
  3. A variable is a place where a data can be stored globally. Each of the letters A through Z (as well as the θ symbol, which is Greek and pronounced "theta") is a variable that can hold a number.
  4. Input happens when a program lets the person running it press a key or type something in, so that it can do something with that. Output happens when a program displays results on the screen.
  5. Control structures are instructions that explain which steps the calculator should follow, and in which order.
  6. The Goto command tells the calculator to jump to another point (more specifically, a corresponding Lbl) in the program, and continue running it from there.
  7. Loops are a type of control structure used to repeat a block of code several times. There are two kinds of loops: a loop that repeats until a condition is satisfied and a loop that repeats a fixed number of times.

Commands Introduced

<< Loops Table of Contents Chapter Exercises >>

This is the end of the first part of the tutorial! To review, here is a sample program that includes the ideas you've learned about in the previous few pages: the traditional guessing game. It will ask you to guess a number between 1 and 1000 in 10 guesses; every time you guess, it will tell you if the number is lower or higher.

The Program

:ClrHome
:randInt(1,1000)→N
:Disp "Guess a number"
:For(I,1,10)
:Input "Guess?",G
:If N=G:Then
:Disp "You've got it!","Guesses:",I
:Pause
:Stop
:Else
:If N>G:Then
:Disp "Higher..."
:Else
:Disp "Lower..."
:End
:End
:End
:Disp "You lose!","The number was:",N

An Explanation

:ClrHome
:randInt(1,1000)→N
:Disp "Guess a number"

The program starts off with a bit of a curve ball: two commands, ClrHome and randInt(, that we haven't really covered yet. ClrHome clears the home screen, and randInt( gives a random number. These will be covered later on, in the second part of this tutorial, so don't worry if you don't quite understand them. In any case, the command randInt(1,1000)→N makes N a random number between 1 and 1000.

Finally, we display "Guess a number" to start off the game.

:For(I,1,10)
:Input "Guess?",G
    ...
:End

To give the player 10 guesses, we use a For( loop that goes from 1 to 10. The variable I is the number of the guess we're on.

The Input command simply asks for a guess, and stores it to G. Remember that N is the number the player's trying to guess.

:If N=G:Then
  :Disp "You've got it!","Guesses:",I
  :Pause
  :Stop
:Else
  :If N>G:Then
    :Disp "Higher..."
  :Else
    :Disp "Lower..."
  :End
:End

This is the most complicated part of the code. To make the nesting of the If commands clearer, it's been indented above, although it wouldn't be on a calculator.

The first check is if N=G: if the guess is correct. If it is, we go to the Then part of the first If. Here we display "You've got it!", and how many guesses it took. We pause the program with Pause, so that the user can read the info we'll provide. Then with the Stop command, we exit the program.

If the guess wasn't correct, we go to the Else part of the first If. Now we need to display a hint - higher or lower. This is accomplished by the second If statement. If N>G, it goes to the Then part, and displays "Higher…" Otherwise, it goes to the Else part, and displays "Lower…" There is no Stop here, so the program continues from there, and does the next cycle of the loop.

:Disp "You lose!","The number was:",N

I'm sure that this code is easy to understand — but why it's here might not be. Think about it, though: this code is right after the End of the For( loop. The For( loop repeated 10 times (once for each guess) without getting here — once it does, that means that 10 guesses have passed; and the player still hasn't guessed the number, or otherwise the program would have stopped.

So once we're here, the player has lost the game. The thing to do now is to display the appropriate message, along with telling him what the right number was.

<< Chapter Exercises Table of Contents More on the Home Screen >>

Loops are a type of control structure used to repeat a block of code several times. Typically, there are two kinds of loops in programs:

  • A loop that repeats until a condition is satisfied
  • A loop that repeats a fixed number of times

In TI-Basic, the first kind of loop is created with the While and Repeat commands, and the second kind is created with the For( command.

While and Repeat

The syntax for these two loops is identical:

:While (condition)
:
    ...
:
:End
:Repeat (condition)
:
    ...
:
:End

In practice, however, they are different. The code inside a While loop will keep repeating as long as the condition is true ("do this while the condition is true"), and exit as soon as the condition is false. The code inside a Repeat loop will keep repeating until the condition becomes true ("Repeat this until the condition is true"). So a loop with While will have the opposite condition of the same loop with Repeat.

There is another subtle difference. The While and For( loops are pre-test loops, which means the condition is checked before you enter the loop. If the condition is false, the loop is skipped entirely. However, the Repeat loop is a post-test loop as the loop is done at least once no matter what. The condition is only checked after a cycle is completed.

The For( Loop

The For( loop is probably the most complicated command we've covered so far. Its syntax:

:For(variable,start,end,step
:
:End

This loop will be repeated once for every value of variable between start and end, increasing it by step each time. For example, For(A,1,10,2) will be repeated once with A=1, then with A=3, then with A=5, then with A=7, and then with A=9 (then the loop stops, because the next value — 11 — is greater than the end value of 10).

By default, the step size is 1, so you don't have to include the step if you want it to be 1. For example, this loop will display the numbers 1 through 10, in order:

:For(A,1,10)
:Disp A
:End

You can also have a negative step size: in that case, the ending value should be less than the starting value, and the value of the variable will decrease each time. For example, this loop will display the same numbers 1 through 10, but in reverse order:

:For(A,10,1,-1)
:Disp A
:End

Some Common Loops

Input validation

Asking repeatedly is not the only way to make sure that input is valid; you might also exit the program if the input is bad, or find a way to interpret bad input as good.

These methods are discussed in more depth in the Validation tutorial.

One way to use a Repeat loop is to make sure that input is valid. For example:

:Repeat X>0
:Disp "ENTER A POSITIVE"
:Input "NUMBER:",X
:End

This program will ask for a positive number in X. After that, the condition "X>0" will be checked — if X wasn't positive, the condition will be false, and the loop will be repeated. So the program will keep asking for a positive number until a positive number is actually entered. This might be useful if your program will not work with negative numbers.

The simplest kind of Repeat or While loop is the infinite loop. This can be done by making Repeat's condition be 0 (false), or While's condition be 1 (true). In either case, the loop will keep going forever.

Finally, For( loops have an unusual use to create delays. For example:

:For(X,1,100)
:End

This code doesn't actually do anything, but repeating the loop 100 times takes some time. This could be useful when you want to pause for a certain time (say, a few seconds) on a screen before displaying the next screen.

Later in this tutorial, you'll learn about the rand command, which can be used as an alternative to For( in creating delays.

<< Labels Table of Contents Ans >>

Next up on the "control structure" miniseries, this page will explain the most general such instruction there is: the Goto command. The idea is simple: this instruction tells the calculator to go to another point in the program, and continue running it from there. Combined with the If command we've already mentioned, this is actually enough to define any sort of sequence of steps you like, even if it's not always the simplest way to do so.

Lbl and Goto

Before telling the calculator to go to another point in the program, we need a way to identify that particular point. There could have been several ways to do this: for example, some ways use the line number. But counting lines in a large program would be a pain, and besides, you'd have to change everything if you inserted an extra line. So TI-Basic uses a different approach, the Lbl command.

Using Lbl is simple: just put it (on a line by itself) at a point in the program you might want to jump to later, and add an identifier. The identifiers TI-Basic allows are one or two characters long, and made up of letters and numbers (so Lbl 0, Lbl XY, Lbl A5, and Lbl 99 are all valid labels). When the program is running normally, the calculator will just skip over a label as though it weren't there.

But once you've made the label, you can use a Goto command to jump straight to it. Goto commands work the same as labels: you give it the identifier you want, and it will jump to the label with that identifier. For example, Goto 0 will jump to the line immediately after Lbl 0.

Some Uses

Exiting a program

Exiting earlier programs wasn't a problem. The calculator keeps going forward, so eventually it will get to the end!

With Goto and Lbl, the calculator can jump backward in the program, so there's a danger of an infinite loop, when the program keeps repeating with no way to exit.

An easy way to exit any Basic program is to use the [ON] key. This will display an error message (ERR:BREAK), and the program will finish running.

Another possibility is with Input commands. Whenever you're in those, you can press [2nd][QUIT] to exit a program.

The first really new thing that we can do with Lbl and Goto is looping over and over in a program. For example:

:Lbl 0
:Disp "HA HA HA"
:Goto 0

This will keep displaying "HA HA HA" repeatedly, and never stop. Without a way to jump around the program, we'd need an infinite number of lines to do this!

You'll often want to pair a Goto with an If statement. Apart from infinite loops, there's not a lot of reasons to always make a jump. But paired with the If command, you can make the calculator go to entirely different parts of the program depending on a condition.

This leads us to an important use of Goto: prematurely exiting a program. When you've written a large program, you might want to stop running it in the middle in certain cases. There are two commands — Return and Stop — that do just that, but Goto provides an alternative. Just make a label (for example, Lbl Q) at the end of the program. Then, you can Goto Q at any time to jump to that label, and exit the program from there. This is useful if you want to always do something at the end of the program, such as displaying "GOODBYE!".

More on the Subject

More info on the Lbl and Goto commands can be found at their respective pages here and here.

The Menu( Command

The Menu( command is one of the coolest uses of labels. It's another form of input: instead of asking the user to type in a value, you're asking the user to make a choice from a menu that looks almost exactly like the built-in menus. After displaying this Menu( and waiting for a choice, the Menu( command will jump to a label that depends on this choice.

The syntax for Menu( is somewhat complicated. First comes a string (in quotes) for the title of the menu. The rest of the parameters come in pairs: a string, in quotes, for a choice in the menu, followed by the label for that choice. For example:

:Menu("SAMPLE MENU","OPTION 1",1,"OPTION 2",2
:Lbl 1
:Disp "OPTION 1!"
:Stop
:Lbl 2
:Disp "OPTION 2!"

This sample program displays a menu called "SAMPLE MENU" with two options, "OPTION 1" and "OPTION 2". With either option, it will go to a label that displays the option you chose, and exits the program.

Because of the size of the screen, you're limited to 7 options or less in a Menu( command.
(NOTE: On the TI-84+ CE, you're allowed up to 9 menu options.)

Problems with Labels

Despite the tremendous convenience of labels, there are two large problems with using them.

The first is speed: jumping to a label can be a relatively slow task (for the calculator, at least). This is because the calculator needs to search through the entire program to find the label. It starts at the beginning, and keeps reading the program until it gets to the end. So if the program is large, and the label isn't at the very beginning, this could take a long time.

The second is more complicated to explain. There are several commands that require an End to finish a block: we've seen this with the If-Then-End form of the If command. Whenever the calculator comes across one of these in a program, it has to use some memory to "remember" to look for an End. When it reaches the End, that memory is freed again.

So what happens if you use a Goto or a Menu( to jump out of the block? The calculator will never find the End it's waiting for. So the memory it used up will never get freed (until the program ends altogether). In fact, if you end up doing this a lot, or even worse, if this is done repeatedly in a looping situation, the calculator will be using a large part of its memory just to keep track of these Ends (this is called a memory leak). Even if this doesn't reach the worst possible conclusion, an ERR:MEMORY, it will slow down the program a lot.

These two problems are a motivation for the several commands we'll see in the next lesson, which provide a better way to do loops like the one we used Goto for in this section. In fact, jumping to the end of the program is one of the only reasons to use Goto, ever.

More on the Subject

More info on the Lbl and Goto commands can be found at their respective pages here and here. You can learn more about the Menu( command here.

<< Logic and Conditions Table of Contents Loops >>

Validation is the process of evaluating user input to ensure it satisfies the specified requirements. Most programs just blindly accept any input that the user enters, assuming that it was entered in correctly and that it is valid. This is a dangerous assumption, because there is a great likelihood that somebody at some point will enter in bad input. When that finally happens, the program will crash when it tries to use the input. In order to ensure this doesn't happen, you should validate user input.

When validating user input, there are three main approaches you can take:

  • Stopping the program — This validation approach involves asking the user for input, and then checking to see if it is a bad input value; if it is, you then just stop the program with a Return or Stop. The idea is that there is no point continuing on to the rest of the program, since the input would only cause the program to crash or get messed up when the input finally gets used.
  • Keep asking for input — This validation approach involves placing your validation inside of a Repeat or While loop, and using a variable as a flag to indicate whether the input is valid or not. The idea is that after asking the user for input, you check to make sure it is not a bad input value; if it is, the bad input flag will be set, and input will be asked for again.
  • Make bad input valid — This validation approach involves asking the user for input, and then trying to filter out any bad parts of the input that might be present. You can make the filters as in depth as you want, but because there is almost an infinite number of things that a user can enter in, there is no way to cover everything. Ultimately, it comes down to knowing the user, and what they are likely to enter in.

How to Validate Variables

There are three main variable types that a user will be asked to input values for in a program: reals, lists, and strings. Each of these variables has their own set of standard validation considerations to check for, along with whatever additional considerations you have in your particular program.

Reals

When validating a real variable, the main things to check for are:

  • Is it within the appropriate range?
  • Is it not a complex number (i.e., there is no imaginary i part)?
  • Is it an integer (i.e., no fraction part)?
  • Is it positive (or zero, if appropriate)?

Testing for these four conditions is relatively easy, considering that there are built-in commands that will take care of it for you: relational operators, the imag( command, and the fPart( command. Generally, you should do the complex number check before the other three checks, because an imaginary part in a number can cause problems.

There's another problem that comes up with using Input specifically. If the input is for a real number A, the user might enter a list, which will be stored to ∟A instead. A simple way of fixing this problem is to store an invalid value to A to begin with, which will be dealt with if the user enters a list and doesn't change A. Many times, this is as simple as using DelVar.

For a simple example of validating a real number, imagine asking the user to specify how many rounds of a game they want to play. A For( loop is used as the main game loop, with the number of rounds being the upper boundary. Since the lower boundary is zero, we want the user to input a number greater than zero. In addition, a For( loop does not work with complex numbers, and we do not want to allow a fraction part because the number of rounds is used to calculate the scoring.

Here is what the validation code for our game might look like with each of the three different validation approaches:

:DelVar AClrHome
:Input "ROUNDS: ",A
:If imag(A
:Return
:If A<1 or fPart(A
:Return
:0→A
:Repeat Ans
:ClrHome
:Input "ROUNDS: ",A
:If not(imag(A
:not(A<1 or fPart(A
:End
:DelVar AClrHome
:Input "ROUNDS: ",A
:max(1,iPart(real(A→A

There are a couple things you should note. In the stopping the program code, we used the Return command to stop the program, instead of the Stop command. This is so that the program will work correctly with subprograms and assembly shells. We used the opposite commands in the making bad input valid code: iPart( instead of fPart( and real( instead of imag(. We are also using the max( command to make one the minimum value for the input.

Lists

When validating a list, the main things to check for are:

  • Is the list length within the appropriate range?
  • Does each list element pass the real validation?

Testing for the list length condition and each of the list elements involves using the built-in dim( command. You first check to see that the list length is acceptable, and then use the dim( command as the upper boundary in a For( loop to go over the list elements one at a time. Each element is validated just like a real variable.

For a simple example of validating a list, imagine you have a lottery game and you want the user to specify three numbers. We want the numbers to be between 1-100, as well as not having an imaginary or fraction part. Here is what the validation code for our game might look like with each of the three different validation approaches:

:ClrHome
:Input "NUMBERS: ",L1
:If 3≠dim(L1:Return
:For(I,1,3
:L1(I
:If imag(Ans:Return
:If Ans<1 or Ans>E2 or fPart(Ans
:Return
:End
:Repeat A=3
:ClrHome
:Input "NUMBERS: ",L1
:DelVar A
:For(I,1,3(3=dim(L1
:L1(I
:If not(imag(Ans
:A+not(Ans<1 or Ans>E2 or fPart(Ans→A
:End:End
:ClrHome
:Input "NUMBERS: ",L1
:For(I,1,3-dim(L1
:randInt(1,E2→L1(1+dim(L1
:End
:3→dim(L1
:max(1,min(E2,iPart(real(L1→L1

Like with the example from before, we had to check for the complex number before checking for the number boundaries and fraction part. This is because neither of those commands work with complex numbers; they will actually throw a ERR:DATA TYPE error. Also important is the optimization that we used to move the list dimension check into the For( loop's upper boundary. This allowed us to eliminate a conditional that we would have had to add.

Strings

When validating a string, the main things to check for are:

  • Is the string length within the appropriate range?
  • Does the string only contain the appropriate characters?

Testing for the string length involves using the built-in length( command. This check by itself is not enough, however, because a string treats commands and functions as just one character (i.e., a string of "ABOutput(" is considered to be three characters long). The way you resolve this problem is by making sure the string only contains certain characters. This involves creating a string of acceptable characters, and then checking the user input against it.

For a simple example of validating a string, imagine you have a two-player hangman game and you want the user to enter in an eight letter word, so that the other player can guess it. The only characters that are allowed are the uppercase alphabet (A-Z), and there is no restriction that the word has to actually exist. (Programming in a check for that would involve keeping a dictionary of words, and that could potentially take up a lot of memory.)

Here is what the validation code for our game might look like with each of the three different validation approaches:

:"ABCDEFGHIJKLMNOPQRSTUVWXYZ
:ClrHome
:Input "WORD: ",Str1
:If 8≠length(Str1:Return
:If not(min(seq(inString(Ans,sub(Str1,I,1)),I,1,8
:Return
:"ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str0
:0:Repeat Ans
:ClrHome
:Input "WORD: ",Str1
:If 8=length(Str1
:min(seq(inString(Str0,sub(Str1,I,1)),I,1,8
:End
:"ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str0
:ClrHome
:Input "WORD: ",Str1
:For(I,1,8-length(Str1
:Str1+sub(Str0,randInt(1,26),1→Str1
:End
:For(I,1,8
:If not(inString(Str0,sub(Str1,I,1
:sub(sub(" "+Str1,1,I)+sub(Str0,randInt(1,26),1)+sub(Str1+" ",I+1,9-I),2,8→Str1
:End

When the user inputs a word, we loop through all of the characters in the word and get their positions in our acceptable characters string. If any of the characters weren't in the string, then their position will be zero, and when we take the minimum of all the positions, the smallest will be zero. With the making bad input valid code, we also concatenate how ever many characters we need to make the word eight characters long.

Making Validation More Friendly

There are a couple different ways you can make validation more user-friendly: displaying error messages when there is bad input, and storing input as a string and converting it to the appropriate variable type.

Displaying error messages to the user when they enter bad input helps the user correct their mistake, and provides some direction on what input you are expecting them to enter. An error message does not need to be complicated or long — just enough so that you can get the point across. For example, say a program is a number guessing game, and the user is expected to enter in a number between 1-1000. If they enter 5000, you can display the message "Between 1-1000".

Storing input as a string allows you to accept any input that the user may enter, even if it is messed up, entered in in the wrong format, or inappropriate for the variable that you are storing it to. This way instead of the program crashing when it gets bad input, it can actually handle it and do whatever it needs to to make it work. You then just check to see if the string has the appropriate value(s), and convert it to the desired variable using the expr( command.

The validation for the real variable, for example, did not include a check for whether it is a list or string. This is because you can only really check for those things when you have a string that you can manipulate. If we wanted to add that check, we can search the string for an opening curly brace and commas or any characters besides numbers. If we find those things, we know that the input is bad, and we can reject it and ask for input again.

In the case of the real variable, the other advantage of using a string is that you don't have to worry about whether the calculator is storing the variable to a list. More specifically, if a list is entered for input, the Input and Prompt commands will actually store the input to a list with the same name. This is possible because you don't need to include the character when referring to a user-defined list. (Entering a string would also work, and the string would become associated with the list.)

Besides checking the list for whether it is a real variable or string, you also can check that it is in the appropriate format. When a list is entered, it needs to start with an opening curly brace, and then have each element separated by a comma. Because most users forget to include the opening curly brace, it is very convenient to place that at the beginning of the list yourself, so that the user never even knows about needing it.

You can take that idea even further, and allow a list to be entered in many different ways: with commas and curly brackets, with commas and no brackets, as a list name (L1 through L6), or as a name starting with ∟, or as a name without the ∟. Instead of requiring one of these, the program might very well be programmed to handle all of them. This all comes down to finding alternate ways of making user input valid.

Thoughts to Consider

The amount of validation you put in a program depends on how large and/or complicated the program is. If you have an extremely complex game with all sorts of user input, then it would be appropriate to include validation for some or most of those things. The general guideline is that the amount of validation needed correlates to the size of the game — i.e., a short math routine probably wouldn't need validation.

While discussing validation, it is also important to mention that since the Input and Prompt commands only work on the home screen, you need to write your own custom input routine using the getKey command if you want to get input on the graph screen. If your entire program is already on the graph screen, however, this should not be an issue, because it makes perfect sense to maintain the user's attention on the graph screen.

Most programs don't follow the same sequence of instructions every time. Depending on its input, a program might want to skip certain steps, or to follow alternative steps instead. Or maybe several instructions need to be repeated over and over again, for a certain number of steps or until they produce the right result. The next few parts of this tutorial will focus on control structures — instructions that explain which steps the calculator should follow, and in which order.

Conditionals are the simplest control structure there is. The idea is simple: the calculator will check if a condition is true or false, and do entirely different things in each case. Of course, first we need to explain logic: what is true, and what is false.

Relations

A note of caution

The statements in this section are very similar to English, which is good because it makes understanding them easier. But it also leads to errors when they don't work the way you expect them to work.

0<X<10 seems okay, but it's not — it actually compares 0<X first, and compares the result (0 or 1) to 10, returning the wrong answer. Use 0<X and X<10 instead.

The building blocks of a condition are the relations =, , >, , <, and . They can check if two numbers are equal or test if one is larger than the other. With these commands, the calculator can compute that 2+2=4 is a true statement, but 1<0 is false.

Try some of these yourself! You can find the relations in the [2nd] [TEST] menu (the 2nd function of the MATH button). If you type some true and false statements on the home screen, you'll see something like this:

2+2=4
        1
2+2>4
        0
100≤10*10
        1

This seems confusing! After all, I said that the calculator checks if a statement is true or false. Where do the numbers 1 and 0 come from? The answer is simple: because the calculator doesn't have separate values for "true" and "false" (which are known as boolean variables in other languages), it's forced to use the numbers 1 and 0 for the purpose. In this context, the value 1 means that a statement is true, and the value 0 means that a statement is false.

Of course, in a program, you're probably not interested in checking whether 2+2=4: this check is going to be the same each time you run the program, so there doesn't seem to be a point. More likely, you'll be checking the values of variables, which as I've said can be used in place of numbers. For example, you might want to check if A=1, or if X≤0.

Logical Operators

Building on relations, we can use logical operators to make more complicated conditions. The four operators are and, or, xor, and not(. You can find them by going to the same [2nd] [TEST] menu where relations were, then pressing the right arrow to go to the LOGIC submenu.

Three of these operators — and, or, and not( — have clear meanings. X=2 and Y=2 means that both X and Y are equal to 2. X=2 or X=3 means that X is either 2 or 3. not(X=Y) means the opposite of X=Y, which we can also write X≠Y.

Even here, we need to make a clarification. The word "or" has several meanings in English, and despite the similarity between the English word and the logical operator, the operator only uses one of these. Specifically, it uses the "inclusive or": if both parts are true, the whole thing is also true. This matches the English in some uses (if you need to pass math or science to get a diploma, you'll certainly get one if you pass both) but not in others (if the meal comes with soup or salad, you'll probably have to pay extra for both).

If you do mean to describe an "either-or" situation, you'll need the xor operator, which stands for "eXclusive OR". This way, the calculator knows what you mean: if you write X=2 or Y=2, it's okay if both are 2, and if X=2 xor Y=2, only one can be 2.

Like relations, logical operators deal with, and return, 1 and 0 to represent true and false.

Conditions

In a program, we want to do more than just check if a statement is true or false. We want to do different things depending on this check. This is accomplished by several forms of the If command:

Simple If

:If (condition)
:(statement)

This simplest form of the If statement imposes a condition on one other line of code. The statement directly after If will be skipped if the condition is false. It works just as it reads: "If X=2:Disp Y" means "If X is 2, display Y".

If-Then-End

:If (condition)
:Then
:(statement1)
...
:(statementx)
:End

One step beyond the simple form, this is what you do when several commands (sometimes most of your program) depends on the condition. Just put a Then immediately after the If - then all the statements until you reach an End will depend on the If condition. You can have one If statement inside another, layered as much as you want.

It's traditional to write If (condition):Then on one line, separating them with a colon and not a new line. This makes code easier to read (you don't have to scroll as much) and looks more like other programming languages. Of course, this is purely voluntary.

If-Then-Else-End

:If (condition)
:Then
:(condition is true)
:Else
:(condition is false)
:End

The most complicated form of If statement. In this case, an alternative action is provided. If the condition is true, everything between Then and Else is done. If the condition is false, everything between Else and End is done instead. There is no single-statement form for this.

Example

Here is an example of the If statement in action. We've embellished the program from the previous section to only accept positive numbers as the side lengths of a rectangle. Now, it will still do the same thing if both A and B are positive — but otherwise it will display a message saying "BAD INPUT!" In the next two pages, we'll learn how to do one better, and actually keep asking for the numbers until they're positive.

:Disp "ENTER NUMBERS >0"
:Input "FIRST SIDE?",A
:Input "SECOND SIDE?",B
:If A>0 and B>0
:Then
:Disp "PERIMETER:",2A+2B
:Disp "AREA:",AB
:Else
:Disp "BAD INPUT!"
:End

More on the Subject

A more complex look at the implementation of logic can be found at the page on piecewise expressions here.

<< Input and Output Table of Contents Labels >>
xlib-xlib-revolution.gif

Program Summary

A quality DDR clone.

Program Size

30KB

Uses Libraries?

Yes, xLIB

Calculator Compatibility

TI-83+/84/+/SE

Author

Kevin Ouellet (DJ Omnimaga)

xLIB xLIB Revolution is a clone of the Dance Dance Revolution game using the xLIB Flash app. Unlike most other calculator clones, this one features quality graphics and runs pretty fast. It also includes a level editor that will allow infinite possibilities for the game. You can even have background images in songs and animations. This is one of the best TI-Basic DDR clones available.

reuben-quest.gif

Program Summary

A quality RPG.

Program Size

120KB (not including most of RAM for in game use)

Uses Libraries?

Yes

Calculator Compatibility

TI-83+/84/+/SE

(Because of the size and complexity, this game is only recommended for those with a 83+SE, 84+, or 84+SE)

Author

Kevin Ouellet (DJ Omnimaga)

Reuben Question is a full-featured RPG, with a good storyline providing several hours of gameplay, flickerless grayscale graphics, complex puzzles, lots of monsters and plot twists, and many mini-games and side-quests.

Of course, none of this is cheap in the memory department. The game literally takes up over 120KB in archive, with it spread out to almost fifty different programs (in particular, each of the maps and bosses are given their own program), and you need to have several of them unarchived in order to actually play the game. Of course, this does not include the actual in game usages that occurs from using all of the real variables, lists, matrices, and strings.

Still, the game is a great achievement in TI-Basic, and surely stretches what people thought is possible.

reign-of-legends.gif

Program Summary

A quality RPG.

Program Size

120KB (not including most of RAM for in game use)

Uses Libraries?

Yes

Calculator Compatibility

TI-83+/84/+/SE

(Because of the size and complexity, this game is only recommended for those with a 83+SE, 84+, or 84+SE)

Author

Kevin Ouellet (DJ Omnimaga)

Reign of Legends is a full-length RPG, which features a good storyline with over 15 hours of gameplay, 3 playable characters, quality graphics and magic animations, four world maps, over seventy enemies, thirty locations with over 1,000 screens, and many mini-games and side-quests.

Of course, none of this is cheap in the memory department. The game literally takes up over 120KB in archive, with it spread out to almost fifty different programs (in particular, each of the maps and bosses are given their own program), and you need to have several of them unarchived in order to actually play the game. Of course, this does not include the actual in game usages that occurs from using all of the real variables, lists, matrices, and strings.

Still, the game is a great achievement in TI-Basic, and surely stretches what people thought is possible.

metroidii.gif

Program Summary

A quality version of the classic metroid game.

Program Size

123KB (not including most of RAM for in game use)

Uses Libraries?

Yes, xLIB

Calculator Compatibility

TI-83+/84/+/SE

(Because of the size and complexity, this game is only recommended for those with a 83+SE, 84+, or 84+SE)

Author

Kevin Ouellet (DJ Omnimaga)

Metroid II features many items from the original metroid like the morph ball, bombs, wave beam, fake walls, destroyable blocks, full of secrets, awesome graphics, many traps, animations, several areas to explore (over 250 maps) and many things that will make your adrenaline increase to insane proportions while playing.

Of course, none of this is cheap in the memory department. The game literally takes up over 123KB in archive, with it spread out to almost fifty different programs (in particular, each of the maps and bosses are given their own program), and you need to have several of them unarchived in order to actually play the game. Of course, this does not include the actual in game usages that occurs from using all of the real variables, lists, matrices, and strings.

Still, the game is a great achievement in TI-Basic, and surely stretches what people thought is possible.

world-empire.gif

Program Summary

A quality version of the classic risk game.

Program Size

5,717 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Arthur O'Dwyer

Download

worldempire.zip

World Empire is a two-player, Risk-style war game against a computer opponent. The goal of the game is to defeat the computer ("Hal") by conquering all of its nations, leaving it with no way to raise an army. If Hal succeeds in conquering all your nations, on the other hand, then Hal wins and you lose.

The map of the world is divided into 20 nations, each of which has two basic characteristics: its current owner and its underlying sympathies. In addition, each nation has one fundamental, immutable characteristic: its productivity, or "value." A nation's value represents how many troops it can produce per turn. For example, China's value is 5, while Greenland's value is only 1. Each nation also has up to four neighbors, with which it can fight or transfer troops.

castle-adventure.gif

Program Summary

A quality text adventure game.

Program Size

6,700 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Arthur O'Dwyer

Download

castleadventure.zip

Castle Adventure is a text adventure game in the style of Infocom or "Colossal Cave". Your goal is to enter the castle and make off with the king's treasure. To achieve this goal, you must solve puzzles by interacting with the game using simple English commands.

The game uses full-text interaction, and an innovative input system. When the game is ready to accept input, a caret ">" will appear on the last line of the screen. Press an alphabetic key, and a word beginning with that letter will appear on the input line. For example, your first move might be to go WEST from the castle gate; therefore, you'd press the W key, and see the fully-formed word WEST appear on the input line.

commerce.gif

Program Summary

A quality card game with AI.

Program Size

5,300 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Arthur O'Dwyer

Download

commerce.zip

Commerce is a three to five player game similar to Rummy, played against two to four computer opponents. There is no automated scoring in this game; rather the goal is to simply win more hands than your opponents. This game features some decent graphics and gameplay, as well as demonstrating good programming practices and code.

donut-quest.gif

Program Summary

A quality puzzle game with donuts.

Program Size

10,276 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Mikhail Lavrov (DarkerLine)

Download

donutquest.zip

A world where the rich hoard donuts in heavily secured mansions, and the poor are left with nothing. A perfect world for a donut thief. Donut Quest is a TI-Basic game of revolutionary quality. It uses no libraries of any kind, in fact, you don't need anything other than the game program to play it. On each of eight levels, you must get to (and eat) all the donuts, then leave through an exit (unless given other instructions). There will be dangerous obstacles ahead of you, and the path will not be easy… but you can always triumph.

minesweeper.gif

Program Summary

A quality version of the classic minesweeper game.

Program Size

3,339 bytes

Uses Libraries?

Yes, xLIB

Calculator Compatibility

TI-83+/84/+/SE

Author

Fred Sparks (CDI)

Download

minesweeper.zip

Minesweeper is another minesweeper clone programmed in TI-Basic. The main feature of this game is its grayscale graphics, which make it one of the best looking minesweeper games available. The game uses the standard controls: arrow keys move the cursor, 2nd uncovers a spot, and ALPHA flags a spot.

tetris.gif

Program Summary

A quality version of the classic tetris game.

Program Size

2,877 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

nitacku

Download

tetris.zip

Tetris is the smallest, fastest tetris clone programmed in TI-Basic. The game features quality graphics, increasing speed with each level, and a high score. The standard controls are used: left and right move a piece, down moves a piece down, and up rotates the piece.

checkers.gif

Program Summary

A quality version of the classic checkers game.

Program Size

13,249 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

nitacku

Download

checkers.zip

Checkers is a one or two player game that follows the standard checker rules for acceptable moves and scoring. The game features several customizable options, including saving and loading, who gets what color pieces, and an ability to change the game rules so that you can jump over your own pieces.

The true highlight of this game, though, is its great AI. It comes with three levels of difficulty, with the strength of the AI being easy, medium, or hard. Unlike other games that just use a simple random number to decide which move the AI will take, this game actually uses sophisticated logic based on the rules of checkers. And to make the AI even better, you can have the AI play against itself.

This tutorial is meant as an introduction to 68k TI-Basic for programmers that already are fairly experienced with TI-83 series Basic programming. Instead of re-teaching many things, this tutorial highlights the differences between the two languages.

Major Features

A major novelty of the 68k calculators is the ability to make symbolic calculations. This has many applications: you can deal with expressions such as x2+2*x+1 but treat x as an unknown, or deal with the exact value of √π/3 without approximating it with floating-point values.

The calculator no longer has some statistical commands, but has much more powerful calculus commands (it can do symbolic derivatives, integrals, and finite and infinite sums, among other things). This doesn't have any immediate programming applications, although you can often find an unexpected use for these commands.

A very programming-relevant difference, on the other hand, is the advent of error catching. Using the Try and EndTry statements, your program can identify if an error has occurred, and possibly even recover from this (or at least display a custom error message).

Also one of the highlights is how much pictures have been empowered. They now can be any size and be displayed with any logic. True "real-time" multiplayer games is now possible with the SendCalc Command, something that was impossible on 83's.

The more specific differences described below tend to combine to make programs run faster, and allow for a programming style closer to programming a more "serious" language on a computer.

Commands

On the TI-89, commands can be entered letter by letter, and don't have to be chosen from a menu. In practice, programs and functions are tokenized, making a command range take up 1 to 3 bytes in a program.

Many commands have been added or removed between the two languages (see the command index for a full list of commands). In addition, the following commands have changed in spelling:

There are two more overall changes. First, many commands' names have been truncated where they were longer than 8 characters: this is the maximum for a command name on the TI-89. An example is RclPic, the 68k equivalent of RecallPic.

Second, the use of parentheses after a command now follows a strict convention.

  • "Instructions" — commands that do not return a value — do not require parentheses (e.g. If, Text, etc.)
  • "Functions" — commands that do return a value — require parentheses (e.g. sin(), setMode(), etc.)
  • Even functions with no arguments use parentheses (e.g. getKey(), startTmr(), etc.)

Many commands have been added. However, as far as statistics goes, the 68k calculators are inferior, even, to the TI-83 series; most of the functionality is now restricted to regressions, and the calculator doesn't even know internally how to calculate most probability distributions.

Variables

The way variables are stored has undergone major changes from the TI-83 series. All variables now share a common naming system: the name of a variable can be up to 8 letters long. Variables can also be placed in different folders, which can't be nested but otherwise are very similar to file folders on a computer. By default, variables are stored in the folder 'main'.

On the surface, the variable types are much the same as they were on the TI-83 calculators: you have numerical variables, lists, matrices, strings, picture variables, equations, graph databases, and a new one, called "data". These are slightly different, however. To begin with, numerical variables can now be either floating-point (the same as on the TI-83 series) or integer variables (that don't have a decimal place, but have several hundred digits of precision). As a consequence of the symbolic operations on a 68k calculator, you also have expressions: formulas that are only evaluated as much as possible.

List are very different. They now can hold any combination of numbers, expressions, and character strings. This makes them more powerful, but also slows them down significantly. Data's are basically matrices, but with the new capabilities (and speed limitations) of the new lists. Matrices stayed the same though, limited to numbers, but retained their speed. You can effectively emulate an "old style" list by using a matrix with only 1 row/column,

Boolean variables will also cause some confusion for TI-83 programmers: Instead of boolean (true/false) operations returning a one or a zero that can be used in the same manner as regular integers (1, 3, -5, 4.8, etc.), boolean variables now all have a class of their own. This means that you can't use a simple "If (variable)" statement to check whether a variable has yet been defined, and can't use shortcuts in expressions that involve a parenthetical boolean statement determining whether a certain term in the expression is used (e.x. (k>2)(x+1)+3x). Instead, you will have to use the ifVar() command to check whether a variable has been defined and return to regular If-Then blocks for conditional computing.

Programs

Programs are also considered variables, on the same level as any other: you can even define a program within another program. They imitate built-in commands, and can even be given parameters. Using the Local command, you can declare local variables that are reset to their old values once a program finishes running.

You can also define functions, which are similar to programs but return a value. Functions have some other limitations, though: they can only use local variables, and can't modify any global aspects of the calculator (so graphical commands, for example, are limited to programs).

With local variables, and the ability to define functions and programs, you can program in a procedural language style. Instead of placing the entire code of the program in one block, you can split it up into functions and subprograms that are defined at the beginning of the main program.

The entire issue of memory leaks (caused on the TI-83 series by jumping out of code blocks with Goto) is no longer present in 68k TI-Basic. Loops have offsets linking the end to the beginning, so the program doesn't need to keep a stack to be aware of what to do with End instructions. There is no longer any memory cost to entering a loop (or any other kind of code block), so it's impossible to leak memory this way.

Optimizations

Most types of trivial optimizations from the TI-83 series are invalid on the 68k calculators. For example, closing parentheses, quotes, and brackets are now mandatory — but don't add any size to the program, since it's tokenized and converted to postfix notation. The Ans variable no longer plays an important role: though the ans() command does exist to replace it, it's not modified by storing to variables inside a program, so it's mostly useful on the home screen.

A large part of 68k optimization revolves around careful use of lists. List variables are no longer random access: accessing the last element of a list is much slower than accessing the first element. For this reason, going through a list in a For loop is about the worst thing you could do.

Graphics

68k gives the programmer much more options with displaying graphics. Sprites, which had to be displayed using various tricks or libraries on a TI-83 series calculator, are built into 68k as picture variables. These picture variables bear little resemblance to the screenshot-like functionality they have on a TI-83+. They can be any size from 1x1 to the entire screen, and can be stored from and recalled to any part of the graph screen. There are even several commands for displaying a sprite using different logic.

Apart from these very powerful commands, more ordinary commands have also been buffed up. Virtually all graphics commands have a point and a pixel equivalent, so you're free to choose one or the other to use (usually, you'll want pixels). The Circle command now draws circles instantaneously, as opposed to taking several seconds.

Instead of being forced to choose between home screen and graph screen, the choice is between graph screen and "Program I/O" screen on the 68k calculators. The program I/O screen is a separate home screen for programs, which is limited to text (but the text doesn't have to be aligned). In addition, both screens can be spiced up using dialogs, which imitate the appearance of a popup window on a computer, and are great for inputting data without having to erase anything from the screen.

Another major addition to the graphics command set is the newly created Dialog feature. New commands add extra I/O capability that doesn't interfere with the program I/O or the graph screen, allowing for enhanced in-program data entry.

There is one limit to graphics on the 68k calculators - they cannot draw over the top menu bar and bottom status bar, so are effectively limited to only 2/3 of the screen. Assembly libraries can be used to access the entire screen, but this is impossible in TI-Basic alone.

Closing Words

This page gives an overview of some of the features of 68k, but it isn't, and cannot, be complete. There are other pages you could visit to get a better picture of 68k programming:

However, the best way to try to learn the language is first-hand experience with it.

solitaire.gif

Program Summary

A quality version of the classic solitaire game.

Program Size

3,993 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

nitacku

Download

solitaire.zip

Solitaire is a card game that involves moving cards around, with the goal of making four stacks of cards (one per suit) in ascending order from Ace to King. The game features nice graphics, as well as good speed and size. The standard controls are used: arrow keys to move, CLEAR to quit, 2nd to select card, ALPHA to draw card, and GRAPH to set a card.

bowling.gif

Program Summary

A quality version of a bowling game.

Program Size

16,384 (is a Basic Builder app)

Uses Libraries?

Yes, xLIB

Calculator Compatibility

TI-83+/84/+/SE

Author

nitacku

Download

bowling.zip

Bowling is a superb TI-Basic game that features quality gameplay and graphics. You start out with $1,000, and you need to make it to the bowling World Championship. You compete against increasingly difficult opponents, although you can purchase items to enhance your skills and abilities. This is a truly fun game.

yahtzee.gif

Program Summary

A quality version of the classic yahtzee game.

Program Size

6,329 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Brad Wentz

Download

yahtzee.zip

Yahtzee is the classic dice game everyone knows. This game is completely graphical, has support for up to 4 players, a save game option, saves high score, displays which categories you qualify for, and runs really fast. This game has all of the rules from the real game, including using the yahtzee as a joker.

officexe.gif

Program Summary

A suite of tools for editing text, presenting slides, and making graphics.

Program Size

8,575 bytes (Document XE)
6,256 bytes (Presentation XE)
6,245 bytes (Draw XE)

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Brad Wentz

Download

officexe.zip

Office XE is a full-featured office package that includes a text editor, presentation/slide show maker, and a graphics program. Each program has a similar interface so if you can use one you can use them all. All of these programs are very advanced and include features never seen before in basic programs.

  • Document XE — A fast, advanced text editor with an easy to use interface.
  • Presentation XE — An easy-to-use slideshow maker with a simple way to organize pictures and create a presentation.
  • Draw XE — A very sophisticated drawing program, with all drawing done on the fly and and several different drawing tools and options available.
chess-pro.gif

Program Summary

A quality version of the classic chess game.

Program Size

6,869 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Francis Huang

Download

chesspro.zip

A chess game that is relatively small and fast, and features move checking, three save slots, and auto-saving. It is one of the best TI-Basic chess games available.

dots.gif

Program Summary

A quality version of the classic dots game.

Program Size

1,311 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Travis Fischer

Download

dots.zip

The classic game of Dots (aka Boxes), popularized by the pencil & paper version, where two or more people take turns connecting a grid of dots with lines in an attempt to form complete boxes. The player who completes the most boxes wins! Features include: 2-9 players, customizable grid width/height, extremely intuitive game controls, and even a preview cursor which shows the user what a line would look like if placed in the current position.

bomberman.gif

Program Summary

A quality version of the classic bomberman game.

Program Size

4,969 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83+/84/+/SE

Author

Travis Fischer

Download

bomberman.zip

This is a graphical rendition of the classic Bomberman genre! The objective of the game is to progress through as many levels as you can, blowing up enemies/bricks and making it safely to the exit. Features include multiple level setups, difficulty settings, randomly generated levels, in-game instructions, and excellent animated graphics.

tower-of-hanoi.gif

Program Summary

A quality version of the classic tower of Hanoi game.

Program Size

2,783 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Martin Johansson (Smoother)

Download

towerofhanoi.zip

The goal is to move all the blocks from one peg to another, and up to thirteen blocks can be changed by the player. A high score is saved for each level, which makes it a simple, but fun game.

blizz.gif

Program Summary

You have to shoot down the buildings before you crash into them.

Program Size

1,863 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Martin Johansson (Smoother)

Download

blizz.zip

You have to shoot down the buildings before you crash into them.

civilization-simulator.gif

Program Summary

A quality version of the classic Sims game.

Program Size

13KB

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Kerm Martian

Download

civilizationsimulator.zip

Modeled on popular computer games, Civilization Simulator lets you control and build an ancient civilization. It uses the ps3d engine, built specifically for this purpose, that provides extremely good graphics in 3D. You start with a blank world and must create people, structures, and trade for your people. The goal is to earn food and wood; when you have enough and have completed sufficient research, you can advance to the next age. After the successful completion of the third age, you win.

world-domination.gif

Program Summary

A quality version of the classic risk game.

Program Size

10KB

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Kerm Martian

Download

worlddomination.zip

World Domination is a real-time strategy game based on games such as Risk; you battle the calculator AI for control of the world. Each player starts with several units to place around the map of the world, then take turns moving, attacking, and redeploying. If you or the calculator gains control of a continent, you get a number of bonus units. Defeat all enemy troops to win the game.

toolbar-separator.png This page needs to be cleaned up. You can help improve TI-Basic Developer by fixing any errors, including any missing information, and adding links to other pages.
toolbar-separator.png This article is a stub. You can help TI-Basic Developer by expanding it.

This is the hall of fame for all programmers who win a challenge at TI|BD.

Challenge # Program Program Description Winner
Challenge 1 TIBD01.zip Rolls user-specified # of dice burrburr
Challenge 2 TIBD02.zip Analog clock w/ AM/PM and date AJLitzau13AJLitzau13
Challenge 3 TIBD03.zip Game introduction (The Matrix) builderboybuilderboy
Challenge 4 TIBD04.zip Converts decimal to Roman numerals patriotsfanpatriotsfan
Challenge 5 TIBD05.zip Converts numbers to words Timothy FosterTimothy Foster
Challenge 6 TIBD06.zip A Custom GUI Zaphod BeeblebroxZaphod Beeblebrox
Challenge 7 CANCELED Create a program that does the order of operations backwards. CANCELED
Challenge 8 TIBD08.zip A game that is less than 1024 bytes large seb83seb83
Challenge 9 TIBD09.zip Custom GUI AJLitzau13AJLitzau13

Darts is a simple game where you want to hit the target ("]") with your dart (">"), while avoiding the obstacles ("^" or "v") in your way. You get one point for each target you hit, and since there are twenty rounds, the maximum number of points is twenty. Although this game is rather simple at its core, it is extremely compact, and a good example of what you can do in a small number of bytes. Like with the other games, try out the game and try to understand and think through the code.

Table of Contents

The Code

:"Ans+8(not(Ans)-(Ans=9→u
:"1-2int(2rand→v
:"randInt(1,8→w
:DelVar SFor(I,1,20
:seq(w,J,1,3→L1
:seq(4J-v,J,1,3→L2
:seq(v,J,1,3→L3
:w→A:1→D:w→B
:DelVar Ev→C
:Repeat D=16 or max(A=Ans and D=L2
:ClrHome
:getKey→K
:If Ans=45:Goto Q
:If Ans=21:1→E
:Output(A,D,">
:Output(B,16,"]
:For(J,1,3
:Output(L1(J),L2(J),sub("^ v",2+L3(J),1
:End
:A+(Ans=34)-(Ans=25
:u→A:D+E→D:B+C
:u→B:L1+L3:u→L1
:End
:S+(A=B and D=16→S
:End
:Lbl Q
:ClrHome:S

The Download

In case you want to try the program on your calculator, you can download the program in .8xp format.

Chase is a simple game where the goal is to chase down the randomly moving target. To make the game more difficult, the old locations of the target are not erased, which makes the target harder to find. This game is small in size and just uses a few real variables. Like with the other games, try out the game and try to understand and think through the code.

Table of Contents

The Code

:1→A:1→B
:8→C:16→D
:ClrHome
:Repeat A=C and B=Ans
:getKey→K
:If Ans=22:Stop
:If Ans:Output(A,B,"  // 1 space
:A+(Ans=34)-(Ans=25
:Ans+8(not(Ans)-(Ans=9→A
:B+(K=26)-(K=24
:Ans+16(not(Ans)-(Ans=17→B
:Output(A,Ans,"X
:Output(C,D,"+
:C+randInt(-1,1
:Ans+8(not(Ans)-(Ans=9→C
:D+randInt(-1,1
:Ans+16(not(Ans)-(Ans=17→D
:End
:Pause "FOUND IT!
:ClrHome:"

The Download

In case you want to try the program on your calculator, you can download the program in .8xp format.

slamsession.gif

Program Summary

A 1 or 2 player basketball dunking game.

Program Size

4,200 bytes

Uses Libraries?

No

Calculator Compatibility

TI-83/84/+/SE

Author

Jason Russell

Download

slamsession.zip

While there aren't many sports games in TI-Basic, this game breaks that mold. The game involves playing against either another player or the calculator, and taking turns trying to make the best dunk possible. Each dunk is given a score from 1-10, and the player with the best cumulative score after three dunks wins.

The most basic dunk is just the standard slam dunk with one hand. You can increase the difficulty, though, by turning your body 180 degrees or doing a two-handed dunk; the more difficult the dunk, the higher the score. The game uses some simple controls: up to jump, right to run, left to stop, and CLEAR to reset.

This game is primarily just a fun time-waster, since once you memorize the best dunk combination, you can always be assured of beating or tying the other player or computer.

bangbang.gif

Program Summary

A quality version of the classic scorched earth game.

Program Size

3,670 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Sean Weeks

Download

bangbang.zip

Bang Bang is a scorched earth clone that involves two players methodically shooting missiles at each other until one of them blows up the other's base. There are three different missile sizes to choose from — small, medium, and large — and each of the missiles has advantages and disadvantages. In addition, there is a wind that affects the missiles, and thus changes which missile you use.

The main feature of this game is that it provides three different modes of gameplay: 1 player, playing against a target; 2 player, playing against another person; and vs. AI, playing against a challenging AI. In addition, the terrain is randomly generated, although you can specify your own custom terrain from the menu as well.

Rock Paper Scissors is a classic game that involves two players choosing among three different hand gestures, and seeing who has the best hand. Each of the hand gestures — rock, paper, and scissors — beats one of the other two hand gestures, so there is a good likelihood that somebody will win. (However, if both players choose the same gesture, it is a tie.) You can play this game indefinitely, but it does get monotonous after a while.

Here is a handy table that tells which hand gesture wins in each situation:

Rock Paper Scissors
Rock Tie Paper Rock
Paper Paper Tie Scissors
Scissors Rock Scissors Tie
Table of Contents

The Code

:ClrHome
:Disp "PAPER - SCISSORS
:Input "ROUNDS:",I
:For(I,1,I
:ClrHome
:Disp "CHOOSE WEAPON:
:Disp "1) ROCK","2) PAPER","3) SCISSORS
:Repeat 2>abs(Ans-2
:getKey-91→J
:End
:Disp "YOU: "+sub("ROCK    PAPER   SCISSORS",8J-7,8
:randInt(1,3
:Disp "CALC: "+sub("ROCK    PAPER   SCISSORS",8Ans-7,8
:Pause "WINNER IS "+sub("YOU CALCBOTH",1+4max(Ans={1,2,3} and J={3,1,2})+8(J=Ans),4
:End
:ClrHome:"

The Download

In case you want to try the program on your calculator, you can download the program in .8xp format.

As a way to test your comprehension of the information, and to ensure that you actually read through the information
instead of merely skimming over it, we have provided review exercises. These exercises provide a way of helping you apply the information, so that you get a fuller understanding of the concepts.

1. True or False: The ClrHome command should be used at the end of a program, to ensure that the program does not leave any leftover text on the home screen.

Answer: True. Although you still will have a Done message at the end. To eliminate this you can add this to the end of your code Output(1,1,"

2. What type of variable cannot hold a complex number?

Answer: Matrix.

3. Which of the following uses of the Disp command returns an error?

  1. Disp
  2. Disp ""
  3. Disp "Hello World
  4. Disp "Hello","World
  5. None of the above.

Answer: None of above.

4. Which draw command cannot be called from a program?

Answer: Pen. It's technically not a command, but it is accessed in the draw menu like a command.

5. What is the difference between the iPart( and int( commands?

Answer: The difference between iPart( and int( is subtle, and many people aren't even aware of it, but it exists. Whereas iPart( always truncates its parameters, simply removing the integer part, int( always rounds down. This means that they return the same answers for positive numbers, but int( will return an answer 1 less than iPart( for (non-integer) negative numbers. For example, iPart(-5.32) is -5, while int(-5.32) is -6.

6. True or False: Programs can use the home screen for everything they can do on the graph screen.

Answer: False. There are no graphics commands available on the home screen.

7. What is the minimal modification that will allow this code to start-up?

:Menu("Choose One,"Menu Item",1,"Menu Item",2
:Lbl A
:Pause "Item 1
:Stop
:Lbl 2
:Pause "Item 2
  1. Add a closing quote on the menu title.
  2. Remove the Stop command.
  3. Change Lbl A to Lbl 1.
  4. Add a closing quote on the menu title and change Lbl A to Lbl 1.

Answer: Add a closing quote on the menu title.

8. In a statistics class, the teacher asks the students to generate a list of 100 random numbers. Unfortunately, the exercise doesn't work as intended because 22 students, in a class of 30, get the exact same numbers (using different calculators). What's a likely explanation for this surprising coincidence?

Answer: They all had the rand command seeded to zero.

9. How many digits of accuracy does the TI-OS have? How many can it display on the screen?

Answer: It has fourteen digits of accuracy, but only ten will be displayed.

10. The Output( command can display text at any place on the screen, but what happens when the text goes past the end of the line?

  1. Nothing. The text simply does not show up.
  2. An error is returned.
  3. The text will wrap around to the next line.
  4. An ellipsis will be displayed at the end of the line, with the rest of the text not being displayed.

Answer: The text will wrap around to the next line.

11. True or False: You need to use a Pause command before clearing the screen, otherwise the user will only see the text on the screen for a couple seconds; it will be a blur.

Answer: False. There are other options available, including using the rand command for a short delay or using a small Repeat getKey:End loop.

12. When is using the Menu command appropriate, and even desired? (Choose the best answer.)

  1. If you want a generic menu.
  2. Your program is going to be text-based.
  3. It is the most practical menu available in your situation.
  4. You want your program to stand out, so you need a fancy menu.

Answer: The first three answers are all good, but the best answer is if you want a generic menu.

13. What would be the effect of replacing a Disp command with an Output command and vice versa? Give any instances where this switch might be useful.

Answer: The Output( command doesn't scroll the screen when it gets to the bottom, like the Disp command does. The main instance where this is useful is when you have lots of text that you are displaying, and the Output( command will wrap it around to the next line.

14. What is the maximum dimension of a list?

Answer: 999. Note, however, that a list that size would barely fit in RAM.

15. Which one statement is true about this code?

:Menu("","",B,"",B
:Disp "Test
:Lbl B
:Disp "Pizza
:Output(1,1,"Spaghetti
  1. An error will be returned when the Menu( command is executed.
  2. The program will execute, but there will not be any text displayed.
  3. The "Test" text will be displayed along with the "Pizza" and "Spaghetti" text.
  4. The "Pizza" and "Spaghetti" text will be displayed, but not the "Test".

Answer: The "Pizza" and "Spaghetti" text will be displayed, but not the "Test".

16. True or False: Before using the Menu( command, you need to clear the home screen, otherwise you will have text interrupting the menu.

Answer: False. The Menu( command uses its own screen, which is separate from the home screen.

17. Consider the following code:

:0:Menu("Difficulty","Easy",3,"Medium",2,"Hard",1
:Lbl 1:Ans+1
:Lbl 2:Ans+1
:Lbl 3:Ans+1

The Ans variable keeps track of the last answer, often being used in place of more permanent variables. If the user selects the "Hard" menu item, what will Ans's value be? What effect does the label ordering have on the value, if any?

Answer: Ans's value will be three. The label ordering causes the value of Ans to be incremented by one for each difficulty level.

18. True or False: Using the home screen is faster than using the graph screen?

Answer: False. Both take the same time.

19. Which of the following cannot be used to test if a variable is any of 1, 2, 3, or 4?

  1. If sum(A={1,2,3,4
  2. If (A=int(A))(A>=1)(A<=4)
  3. If A={1,2,3,4}
  4. If A(int(A)=A)(A<5)

Answer: If A={1,2,3,4} because the If command does not work with lists.

20. True or False: The following is an alternate to using the or operator.

:If (X=1)+(X=2

Answer: True.

21. Name a command or function that cannot be interrupted by pressing the [ON] key.

Answer: randBin(, SortA(, and SortD( all will work.

22. For which of the following would not(B) not equal 0?

  1. .01→B
  2. 0→B
  3. π→B
  4. -4→B

Answer: 0→B. Remember that not( negates the value, so 0 becomes 1.

23. True or False: The following is an alternative to using the and operator.

:If Anot(B

Answer: True. Remember that multiplication is implicitly done on the TI-83 calculators.

24. How many bytes is an uppercase character? A lowercase character?

Answer: An uppercase character is one byte, while a lowercase character is two bytes.

25. Which of these user-created list names are actually possible on the calculator?

  1. L1234
  2. LBaDd
  3. Lθθθθ
  4. LABCD

Answer: Lθθθθ and LABCD. A list can't start with a number, and lowercase letters aren't allowed.

26. What type of variable needs a special command to store to it?

Answer: Picture and GDB. You use the StorePic and StoreGDB command.

27. Change this short program so it doesn't flicker and then optimize it as much as possible.

:4→X:4→Y:Repeat 0
:ClrHome
:Output(Y,X,"X")
:getKey→K
:If K=24:X-1→X
:If K=25:Y+1→Y
:If K=26:X+1→X
:If K=34:Y-1→Y
:End

Answer: Here is one possibility:

:4→X:4→Y:Repeat 0
:Output(Ans,X,"X
:Repeat Ans:getKey→K:End
:Output(Y,X,"  // 1 space
:X+(Ans=26)-(Ans=24→X
:Y+(K=34)-(K=25→Y
:End

28. True or False: You can archive another program from within a program.

Answer: False. You can, however, archive another program outside a program.

29. What is the maximum length of a string?

Answer: There is none. It is only limited by the amount of RAM.

30. Which of the following variables is it possible to archive?

  1. Y1
  2. prgmKEWLGAME
  3. the real variable T
  4. the real variable A
  5. ∟RESID
  6. L1

Answer: prgmKEWLGAME, the real variable A, and L1. Trying to archive Y1T,, and ∟RESID will give you an ERR:VARIABLE error.

31. Without trying it first, is this legal?

:[A]L4([A]([A](L1(1),L2(1)),L1(1(L2(2L3

Answer: No. While the syntax is correct, an error is returned when trying to get the particular element multiplied by the entire L3 list.

32. How would you find the fifth element from the last in a sequence of 20 elements?

Answer: Assuming the list is L1, you would just use:

:L1(15

33. What will this code do?

:DelVar B1→A
:If A:If B
:Disp "Hello World

Answer: Nothing. It doesn't output anything on the screen.

34. How do you get rid of the Done message at the end of a program?

Answer: You can remove the "Done" message that appears after a program is finished running by placing an expression, some text, or just a quote on the last line of your program.

35. Write a program that inputs a string and outputs the letters backward, one per line.

Answer: Here is one possibility:

:Input "TEXT:",Str1
:For(X,length(Str1),1,-1
:Disp sub(Str1,X,1
:rand(10
:End

36. Will this code execute?

:If 0:Disp "Your turn
:Else:Disp "Guess not

Answer: No, it will give you an error.

37. What is the simplest program you can have that has recursion?

Answer: A one-liner that just calls itself:

PROGRAM:A
:prgmA

38. Which of these are logically equivalent?

  1. not(P or Q)
  2. P and Q
  3. not(P and Q)
  4. not(P) or not(Q)
  5. not(P) and not(Q)

Answer: "not(P or Q)" and "not(P) and not(Q)" are logically equivalent, while "not(P and Q)" and "not(P) or not(Q)" are logically
equivalent. This is based off of DeMorgan's Law.

39. True or False: There are actually 256 picture variables on the calculator, even though only 10 picture
variables show up.

Answer: True. Although the other 246 must be accessed through asm.

40. What are the differences between assembly and TI-Basic? When would you use assembly and when would you use TI-Basic?

Answer: Unlike TI-Basic, which uses commands and functions that are easy to understand, assembly is programmed in the calculator's own machine language, and thus is much harder to program in and read. You would use assembly when you want your program to be fast, and you would use TI-Basic when you want to program your game fast.

41. How long will the program go through the loop until it stops execution?

:0→X
:While X
:Disp "Another Loop
:X+1→X
:If X=25
:Stop
:End

Answer: Trick question the while loop is false.So X never changes and it ends at 0.

42. What is wrong with this code?

:If X=25 Then
:Disp "X is 25
:X+1→X
:Disp "X is now", X
:End

Answer: You need to change the space between X=25 and Then to a colon, and remove the space to the left of the second X in Disp "X is now", X:

:If X=25:Then
:Disp "X is 25
:X+1→X
:Disp "X is now",X
:End

43. What are the only keys that will be repeated if they are held down?

Answer: The arrow keys and DEL.

44. How would you go about converting a list to a matrix? What would the code look like?

Answer: Just use the List►matr( command.

45. True or False: There is no built-in way to convert a string to a number.

Answer: False. The expr( command does this.

Routine Summary

Looks through a list to find the first non-zero element.

Inputs

list - The list or list variable to look through.

Outputs

The index of the first non-zero element in the list.

If all the elements are zero, the result is one greater than the size of the list.

Variables Used

None erased.

Calculator Compatibility

TI-89/92/+/V200

:firstnz(list)
:1+sum(floor(1/(1+cumSum(abs(list))))

This function finds the first non-zero element in a list, and returns its index.

The innermost part of the formula makes the list easier to deal with: abs() makes all non-zero elements positive, then cumSum() ensures that after the first non-zero element, every next element in the result is also non-zero. After this, the list begins with some number of zeroes (possibly none at all), then only positive numbers. Now, to find the index of the first non-zero element, we must find the number of zero elements, and add 1.

The function floor(1/(1+x)) sends 0 to 1/(1+0)=1, and every positive number to 0. After we apply it to the result above, all the zeroes are replaced by 1, and all the other numbers by 0. Then, sum() adds all the 1s, counting the number of elements that used to be 0. Adding 1 to the result gets the index of the element one past all the zeroes, which is the result we want.

This explanation still doesn't answer the real question: why such a bizarre approach when a more simple one is possible — going through the list in a For..EndFor loop, and checking if each element is 0 until you get to one that's not? The answer is that accessing list elements one by one is very slow: to get to a middle element of a list, the calculator must go through all the elements before it. This means that when you access a list's elements in a For loop, you're going through the entire beginning of the list each time the loop cycles.

To avoid this, we use commands that deal with all the elements of a list at once. Because their code is written in the calculator's own assembly language, it doesn't have to go through this rigmarole to access a list. As a result, the strange-looking routine is faster, and its advantage becomes greater and greater with long lists.

Error Conditions

210 - Data type happens when the input is not a list.

dinoeggs.gif

Program Summary

A remake of the Puzzle Pack game Dino Puzzle.

Program Size

2,357 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Alex Snyder (axcho)

Download

dinoeggs.zip

Dino Eggs is a remake of the popular Dino Puzzle game from the Puzzle Pack application released by Detached Solutions. The objective is to match falling shapes with similar shapes on the field. You do this by moving a cursor and switching two rows at a time to align them with the two incoming shapes before they land and another pair descends.

As you can see in the screenshot, the game runs on the home screen, and uses simple text for the cursor and everything else. Of course, the main feature of the game is that it provides almost unlimited gameplay, since the shapes are randomly selected and they keep descending until you lose or quit.

If you get tired, you can save the game and come back to it at a later time. Similarly, the game stores the highest score, so you can compete with friends to see who is the king. The game uses the standard controls: up and down move the cursor, 2nd switches the two selected rows, MODE saves the game, and CLEAR quits.

snake-escape.gif

Program Summary

A game similar to falldown, but with a fun twist.

Program Size

1,120 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Alex Snyder (axcho)

Download

snakeescape.zip

Snake escape is similar to the game falldown, with the main difference being that you have to avoid a snake while collecting bananas. You can move left and right, and if you go off the screen, you will wrap around to the other side. In addition, if you go over a gap, you will fall down to the next level.

As you can see in the screenshot, the game runs on the home screen, and uses simple text for the snake and everything else. Of course, the main feature of the game is that it provides almost unlimited gameplay, since the gaps in each level are randomly generated and the levels keep going until you lose. The only controls in the game are left and right to move.

The following table proposes an extension to the (incomplete) set of ASCII codes classically exported by TI-GRAPH LINK, emulated by those with limited access to better portrayals of targeted characters, and utilized by those seeking to preserve their content in the 7-bit range. Each consists of no more than eight characters.

Cells containing symbols that already have 7-bit encodings are omitted. This includes letters and digits, brackets and other punctuation, and the alternate figures found on the number keys of most keyboard layouts. Each of these items can be typed out like normal, or encased in backslashes wherever convenient or necessary.

This is an alternative, often last-resort approach to rendering the TI-83 Plus font on a computer. Environments that support UTF-8 might be more well-suited for Unicode characterizations that rise above the 7-bit limit. For ways to represent TI-83 Plus characters in their full splendor, see the TI-83 Plus Large Font article.

Table of ASCII Output Codes
01–7F 80–A6 A7–CD CE–F4
LrecurN 01 \n\ Lsub0 80 \0\ LoGrave A7 \ograve\ Lellipsis CE \...\
LrecurU 02 \u\ Lsub1 81 \1\ LoCaret A8 \ocirc\ Lleft CF \<\
LrecurV 03 \v\ Lsub2 82 \2\ LoDier A9 \ouml\ Lblock D0 \block\
LrecurW 04 \w\ Lsub3 83 \3\ LcapUAcute AA \Uacute\ Lper D1 \per\
Lconvert 05 \>\ Lsub4 84 \4\ LcapUGrave AB \Ugrave\ Lhyphen D2 \-\
LsqUp 06 \squp\ Lsub5 85 \5\ LcapUCaret AC \Ucirc\ Larea D3 \area\
LsqDown 07 \sqdown\ Lsub6 86 \6\ LcapUDier AD \Uuml\ Ltemp D4 \^box\
Lintegral 08 \intgrl\ Lsub7 87 \7\ LuAcute AE \uacute\ Lcube D5 \^3\
Lcross 09 \x\ Lsub8 88 \8\ LuGrave AF \ugrave\ Lenter D6 \enter\
LboxIcon 0A \box\ Lsub9 89 \9\ LuCaret B0 \ucirc\ LimagI D7 \i\
LcrossIcon 0B \cross\ LcapAAcute 8A \Aacute\ LuDier B1 \uuml\ Lphat D8 \p^\
LdotIcon 0C \dot\ LcapAGrave 8B \Agrave\ LcapCCed B2 \Ccedil\ Lchi D9 \chi\
LsubT 0D \subT\ LcapACaret 8C \Acirc\ LcCed B3 \ccedil\ LstatF DA \statF\
LcubeR 0E \root3\ LcapADier 8D \Auml\ LcapNTilde B4 \Ntilde\ Llne DB \e\
LhexF 0F \hexF\ LaAcute 8E \aacute\ LnTilde B5 \ntilde\ LlistL DC \L\
Lroot 10 \root\ LaGrave 8F \agrave\ Laccent B6 \acute\ LfinanN DD \N\
Linverse 11 \^-1\ LaCaret 90 \acirc\ L2_r_paren DE \))\
Lsquare 12 \^2\ LaDier 91 \auml\ Ldieresis B8 \..\ LblockArrow DF \blk->\
Langle 13 \/_\ LcapEAcute 92 \Eacute\ LquesDown B9 \iquest\ LcurO E0 \cursor\
Ldegree 14 \o\ LcapEGrave 93 \Egrave\ LexclamDown BA \iexcl\ LcurO2 E1 \2ndcur\
Lradian 15 \r\ LcapECaret 94 \Ecirc\ Lalpha BB \alpha\ LcurOcapA E2 \Acur\
Ltranspose 16 \^T\ LcapEDier 95 \Euml\ Lbeta BC \beta\ LcurOa E3 \acur\
LLE 17 \<=\ LeAcute 96 \eacute\ Lgamma BD \gamma\ LcurI E4 \inscur\
LNE 18 \!=\ LeGrave 97 \egrave\ LcapDelta BE \Delta\ LcurI2 E5 \ins2nd\
LGE 19 \>=\ LeCaret 98 \ecirc\ Ldelta BF \delta\ LcurIcapA E6 \ins_A\
Lneg 1A \(-)\ LeDier 99 \euml\ Lepsilon C0 \epsil\ LcurIa E7 \ins_a\
Lexponent 1B \EE\ LcapIAcute 9A \Iacute\ LGline E8 \gline1\
Lstore 1C \->\ LcapIGrave 9B \Igrave\ Llambda C2 \Lambda\ LGthick E9 \gline2\
Lten 1D \10\ LcapICaret 9C \Icirc\ Lmu C3 \mu\ LGabove EA \gabove\
LupArrow 1E \uarrow\ LcapIDier 9D \Iuml\ Lpi C4 \pi\ LGbelow EB \gbelow\
LdownArrow 1F \darrow\ LiAcute 9E \iacute\ Lrho C5 \rho\ LGpath EC \gpath\
LiGrave 9F \igrave\ LcapSigma C6 \Sigma\ LGanimate ED \ganim\
Lfourth 24 \^4\ LiCaret A0 \icirc\ Lsigma C7 \sigma\ LGdot EE \gdot\
LiDier A1 \iuml\ Ltau C8 \tau\ LUpBlk EF \upblk\
Ltheta 5B \theta\ LcapOAcute A2 \Oacute\ Lphi C9 \phi\ LDnBlk F0 \dnblk\
LcapOGrave A3 \Ograve\ LcapOmega CA \Omega\ LcurFull F1 \chkrbd\
Lbackquote 60 \lsquo\ LcapOCaret A4 \Ocirc\ LxMean CB \xbar\
LcapODier A5 \Ouml\ LyMean CC \ybar\ LsqUp F3 \squp_2\
LinvEQ 7F \=\ LoAcute A6 \oacute\ LsupX CD \^x\ LsharpS F4 \szlig\
pipes.gif

Program Summary

A quality version of the classic pipes game.

Program Size

5,276 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Sean Sartell (staind234)

Download

pipes.zip

Pipes is an action / puzzle game that involves connecting pieces of pipe to the single piece of pipe that you start out with, with the goal of trying to make one continuous pipe so that the water doesn't reach the end. You are given a set amount of time to assemble the pipe before the water is unleashed, and because the pipe pieces are randomly generated, you need to use that time wisely.

Each round you have a set number of points that you need to reach with the water flowing in the pipe, and if you don't reach that point total, the game is over. If you were able to survive long enough, you might have qualified for a high score.

The game runs strictly on the graph screen, and features a nice graphical interface, title screen, and menu, as well keeping track of the top five high scores. Of course, the main feature of the game is that it provides almost unlimited gameplay, since the pieces are randomly generated and the rounds keep going until you lose. The standard controls are used: 2nd to make a selection and arrow keys to move.

dstar.gif

Program Summary

A quality version of the classic dstar game.

Program Size

4,800 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Scott Davis

Download

dstar.zip

DStar is a fun puzzle game that involves moving around a + sign and a box to collect all five of the pieces in the fewest moves possible. While that sounds easy, the + sign always moves until it gets to a wall, so you have to be very methodical in planning how to collect the pieces (i.e., you need to use the box to get the necessary positioning). Also note that you can swap the + sign and the box, but that counts as a move as well.

The game features several built-in levels that you can play, but it also has support for a level editor and external levels. Using the level editor is a breeze — you just press the appropriate F# keys to add or remove the walls, + sign, box, and pieces, and then press ENTER when you are done to save it. In addition, the game also allows you to save and load, which means you can save your progress without worrying about it being deleted.

Like most of the other dstar clones, this version runs strictly on the graph screen, and features a nice graphical interface. The game uses the standard controls: the arrow keys move the + around, ALPHA starts the level over again, TRACE saves the game, GRAPH loads the game, and DEL exits the game.

lights_out.gif

Program Summary

A quality version of the classic lights out game.

Program Size

3,400 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Scott Davis

Download

lightsout.zip

Lights Out is a fun puzzle game that involves trying to turn off all of the lights. While that sounds easy, when you select a square it inverts not only the square itself, but the four squares surrounding it (i.e., if a square is on, it will be turned off, and vice versa).

The game features three different modes of play — normal, random, and custom — which means it will be staying on your calculator for a while until you beat it. Speaking of which, when you win the game, you get a nice win sequence that is reminiscent of the classic Tiger handheld version.

Unlike some of the other lights out clones, this version runs strictly on the graph screen, and features a nice graphical interface. The game uses the standard controls: the arrow keys move the cursor, while 2nd/ENTER makes a selection in the menu and on the game board.

metroidpi.gif

Program Summary

A quality version of the classic metroid game.

Program Size

17KB

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Robert Moy (Harrierfalcon)

Download

metroidpi.zip

Metroid Pi is a pure TI-Basic version of the classic Metroid game, with the game following the standard storyline of making your way through several increasingly difficult areas, while battling enemies, bosses, and getting powerups that allow you to beat the next area in the game. The game utilizes the graph screen throughout, making use of the layered graphics technique that Super Speler came up with in his Zoith game, but the sprites themselves are still reminiscent of the home screen text.

Of course, none of this is cheap in the memory department. The game takes up over 17KB, with it spread out over seventeen different programs (in particular, each of the three bosses and three maps are given their own program), and you need to have each of these files unarchived in order to actually play the game. Of course, this does not include the actual in game usage that occurs from using all of the lists, strings, and real variables, which is another 5KB of memory.

Still, the game is a great achievement in TI-Basic, and surely stretches what people thought is possible.

sudoku.gif

Program Summary

A quality version of the classic sudoku game.

Program Size

4,051 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

Harrierfalcon

Download

sudoku.zip

Sudoku is a puzzle game that involves filling a 9x9 grid so that each column, each row, and each of the nine 3x3 boxes contains the digits 1 to 9 only one time. You start out with a partially filled grid with each 3x3 box containing anywhere from one to five numbers, and you then have to fill in the rest.

This sudoku games comes not only with five pre-solved sudokus, but it also has support for creating randomly generated sudokus. Unlike some other sudoku games that simply change the arrangement of the numbers, which isn't really random at all, this game actually creates totally new sudokus by swapping the rows of existing sudokus.

The game features a good graphical interface, with easy to use controls. It does, however, use a considerable number of variables, including five matrices, the majority of the real variables, all six of the built-in lists, and a string. This means you have to make sure you don't have anything in those variables, since it will be erased.

xmove15.gif

Program Summary

A quality version of the classic number slider game.

Program Size

1,574 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

XprO

Download

xmove15.zip

Xmove15 is a small, but fun puzzle game that involves moving numbers around a 4x4 board until you get them in the order 1 to 15 (with the numbers wrapping from the right edge to the left edge on the next row). You control a cursor that you use to move the numbers: put the cursor over a number next to the empty spot, and the number and the empty spot will be swapped when you press 2nd.

Just like with XprO's other quality game, Xsnake, Xmove15 features great TI-Basic code. The game makes ample use of control structures, with a very easy to follow organization and setup, as well as showcasing several optimizations for speed and size. Simply put, it is a lot of fun to look at the underlying code, and to see what is possible in a small number of bytes.

xsnake.gif

Program Summary

A quality version of the classic snake game.

Program Size

1,468 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

XprO

Download

xsnake.zip

Xsnake is one of those rare TI-Basic games that not only are fun to play, but also fun to look at the underlying code. The game is written entirely in TI-Basic, but it is as fast as the assembly snake counterparts — in fact, it is the fastest TI-Basic snake game available.

The main innovation that allowed Xsnake to be so fast is that the four arrow directions are each split up into their own separate loop, which cuts down on If conditionals and other speed impediments. The game also uses the pxl-Test( command for collision detection, which is faster than accessing a variable (like most other snake games do).

In terms of gameplay, Xsnake features the standard goal: you go around eating food, but each piece of food makes the snake grow longer. The game comes with seven built-in levels of increasing difficulty that you need to make your way through to beat the game, and you have to do it with only three lives.

The game uses the standard controls: 2nd/ENTER to pause in the game, CLEAR to quit, and the arrow keys move the snake in the respective direction. The graphics are not sophisticated by any measure, but that isn't really the focus of the game anyway.

The featured articles are articles that represent the best TI-Basic Developer has to offer. A featured article meets all of the following requirements:

  • Well-Written — It is easy to read, flows smoothly, and does not have any spelling or grammatical errors.
  • Complete — It includes everything about the topic, including theory, code examples, and screenshots, when appropriate.
  • References — If applicable, it lists the sources that were used in putting together the article.

To nominate an article for being featured, add it to the list below.

Featured Article Candidates

Featured Articles

The ListPages module does not work recursively.

Did you know…

The ListPages module does not work recursively.

{$part1begin}

To add an article, move the current featured article from {$part2} to {$part3}, and add a new featured article to {$part2}. See the featured articles page to view the data on this page in a cosmetic format.

{$part1end}
{$part2begin}

"Sprites" are small images displayed as part of a larger scene on the screen. In TI-68k Basic, support for sprites is built-in, in the form of picture variables.

The most common reasons to use a sprite are to display a picture which will be moved around on the screen, or repeated multiple times as part of a pattern (more...)

{$part2end}
{$part3begin}

"Tokenization" is the process whereby the characters that make up a command are replaced by a token — a number representing the command.

Since the size of the program is determined by its tokenized size, understanding this process is key to optimization, at least for size. (more...)

{$part3end}

{$part1begin}

To add a DYK, move the second DYK from {$part2} to {$part3}, and add a new DYK to {$part2}. See the Did You Know... Archives page to view the data on this page in a cosmetic format.

{$part1end}
{$part2begin}

…that displaying sprites to column coordinates divisible by 8 is faster than to other coordinates?

…that setmode() and similar commands have an alternate "programmer's syntax"?

…that strings are the fastest data type to access, given enough elements?

{$part2end}
{$part3begin}

…that the ok system variable checks if a dialog was cancelled?

…that the 26 one-letter variables a-z are much smaller to access?

…that the © character can be used to enter comments in programs?

…that ending a variable name with an underscore _ will make solve() and cSolve() assume it's complex?

…that you can treat strings as always-undefined variables in symbolic math?

{$part3end}

{$part1begin}

To add any news, move the fifth news item from {$part3} to {$part4}, and add a new news item to {$part3}. The date format is day/month.

See the News Archive page to view the data on this page in a cosmetic format.

{$part1end}
{$part2begin}

2008

{$part2end}
{$part3begin}
04/09burr, the founder of the site, has finished contributing to the site, and moved on to other projects. (see his goodbye here)
01/09 — TI-Basic Developer has now existed for approximately two years. Thanks to all that made it a great year, and may the next year be even more successful and exciting.
11/06James Kanjo created a "New Members" section on the home page
18/05 — The development of the TI|BD site logo is complete, and has now replaced the previous site header.
15/05James Kanjo has set up a new framework for infoboxes.
{$part3end}
{$part4begin}
04/05krazyness initiated the development of the TI|BD site logo, to replace the current header.
02/04 — The home page has been updated to automatically retrieve text for news, "did-you-know" tips, and featured articles.
02/04James Kanjo made the Start page automatically retrieve the first 5 news items from the old news section.
30/03burr started the downloads page, and added all of the 68k tutorials that he found on the Internet.
13/03DarkerLine added include pages which make adding a new command page much easier. Go for it!
08/02DarkerLine started a tokenization page, detailing what tokenization is and how it impacts program size and optimization.
02/02DarkerLine put together a calculators page, which provides a brief, but detailed look at the different calculators and their specifications.
01/02DarkerLine started the key codes page, as well as the character codes page.
31/01burr created 68k versions of all of the relevant system pages, which will hopefully minimize any ambiguity or uncertainty about where you are on the site.
31/01DarkerLine added an errors page that lists all of the possible error messages that can occur, including the error numbers and their descriptions.
29/01DarkerLine begins work on this section of the site, creating the homepage, top navigation, command stub and the command index.
{$part4end}

{$part1begin}

To add any news, move the fifth news item from {$part3} to {$part4}, and add a new news item to {$part3}. The date format is day/month.

See the News Archive page to view the data on this page in a cosmetic format.

{$part1end}
{$part2begin}

2008

{$part2end}
{$part3begin}
03/10James Kanjo made a new Did You Know… system, where each DYK has it's own page in the dyk category. Now the DYK on the home page sidebar displays a randomly selected DYK.
01/10James Kanjo added a choose a "random command" link to the sidebar…COOL!
27/09Timothy Foster created the page TI-Nspire Programming.
15/09James Kanjo upgraded the framework of the TI|BD archives. Now it is even easier to add, update, rate and moderate programs!
04/09burr, the founder of the site, has finished contributing to the site, and moved on to other projects. (see his goodbye here)
{$part3end}
{$part4begin}
04/09James Kanjo tagged the 25 remaining untagged "redirect" pages
04/09basickevin created the page artificial intelligence
03/09RandomProductions created the page How the Calculator Works.
01/09 — TI-Basic Developer has now existed for approximately two years. Thanks to all that made it a great year, and may the next year be even more successful and exciting.
28/07burr did some reorganization and cleanup to the resources page.
14/07Zaphod Beeblebrox created the page Text Sprites Reference
08/07basickevin created the page alternate routines to promote the creation of new optimizations
03/07burr and James Kanjo set up the framework for the new TI|BD archives
01/07Mapar007 created the page Binary and Hexadecimal number system
20/06Zaphod Beeblebrox changed the resources page to use the tabview
13/06James Kanjo added an "Instant Messenger" routine to the programs page
11/06James Kanjo created a "New Members" section on the home page
06/06James Kanjo finished integrating the new infobox framework into all 324 command pages
02/06burr updated the showcases page separating the programs by genre and using the tabview.
24/05RandomProductions spruced up the user input page to be a bit more recent.
18/05 — The development of the TI|BD site logo is complete, and has now replaced the previous site header.
10/05James Kanjo has set up a new framework for infoboxes.
04/05krazyness initiated the development of the TI|BD site logo, to replace the current header.
24/04DarkerLine has finished the first chapter of the Starter Kit, a tutorial for beginner programmers.
23/04burr created a validation tutorial that covers how to approach validating user input.
16/04burr added a file download to all of the routines and programs.
12/04burr created a TI-Basic Sidebar for Mozilla Firefox for quick reference of the TI-83 commands when you are away from the site.
02/04DarkerLine, Socks and James Kanjo worked together to upgrade the implemented "include template" sections of the site. Result: Site automatically retrieves the required parts of the "Recent News", "Did You Know" and "Featured Article" sections for the home page.
02/04James Kanjo made the Start page automatically retrieve the first 5 news items from the old news section.
30/03burr started the Featured Articles page that lists the best articles available on the wiki, along with changing the "Featured Article" section in the sidebar on the homepage into an include page.
27/03burr started a Did You Know... page with a list of premade DYK's, along with changing the "Did You Know…" section in the sidebar into an include page.
25/03James Kanjo added a warning to the grouping section, which the TI-Basic community may have previously been unaware of.
16/03Weregoose created two pages on the calculator's internal fonts. DarkerLine has already found these images useful on other pages.
08/03Socks started working on the TI-Basic Starter Kit. Feel free to contribute.
23/02RandomProductions put screenshots on all of the date and time command pages.
09/02burr created a portal page, which acts as a bridge between the TI-83 and 68k sections of the site, and is now the new homepage for the site.
29/01DarkerLine begins work on the 68k section of the site.
29/01 — All commands have now been documented! Woo!
26/01burr added an optimization walkthrough tutorial which takes a person through the literal process of optimizing a game.
24/01DarkerLine broke up the text manipulation page into a few routine pages: highlighting text, wordwrapping text and marquee.
09/01 — The zoom commands have been documented, finishing up all commands except for the finance ones.

2007

16/12 — The xLIB Guru has merged with this wiki, and its content has been added.
13/12 — The page about user settings, along with its various subpages, is now complete.
11/12burr created a Boolean logic page detailing what Boolean logic is and how you can use it in your programs.
27/11DarkerLine finished writing the pages about the various variable types, and started on the settings commands.
24/11simplethinker started creating pages for the trigonometry and polar functions.
22/11burr added tags to the majority of the pages; only the command pages are left.
18/11DarkerLine started creating pages for the different variable commands.
16/11DarkerLine finished creating pages for the individual math commands.
06/11burr created a self-modifying code page explaining what self-modifying code is and how you can use it.
18/10burr began to create individual routines pages, using the new routine template
15/10alexrudd began to split up the math page into separate command pages.
14/10burr created a downloads page with over 100 zip files to download.
01/09 — TI-Basic Developer has now existed for approximately a year. May the next year be even more successful and exciting.
26/07burr put together a Frequently Asked Questions (FAQ) list of common TI-Basic related questions that people ask.
24/07burr made a Sitemap that has a hierarchical breakdown of the site for easy viewing.
22/07burr started a Common Coding Pitfalls page, which lists several different examples of code that are syntactically correct, but do not produce the correct or desired results.
01/07burr started a Code of Conduct page, which lays down some general conduct rules to follow when contributing to the wiki.
27/06burr started a Glossary page, which has general definitions for several of the words that are used throughout the wiki.
26/06burr created a Code Commenting page, which is extremely useful for those people who are working on multiple projects at the same time, and want to be able to come back to a project without all the stress of figuring out what everything is again.
23/06burr finished updating the Subprograms page, so now the external and internal subprograms are explained in comprehensive detail.
22/06Xphoenix added a general section to the Program Setup page, and also created two pages: Assembly Shells and Basic Builder.
22/06burr started a Program Setup page in the same fashion as the Program Cleanup page. Program setup includes getting the home screen, graph screen, and variables ready so your program can use them.
18/06DarkerLine finally finished the Statistics pages. He's going to go back and add complicated formulas no one understands sometime later.
13/06DarkerLine started working on the Statistics pages like he said he was going to a month ago…
03/06Xphoenix created pages for some of the Graph Screen commands.
05/05Harrierfalcon optimized one of the examples on the Compression Techniques page by using the seq( command.
30/04alexrudd added the xor and not( operators to the Logical Operators page.
22/04burr started the Project Challenges page. After you have gone through the wiki and learned the commands, design theory, and game techniques, you can now test yourself and try your hand at making some programs.
21/04burr started the Old News page, which is the archive place for all the old news and is kept for posterity sake.
19/04 — A few more games have been added to the Programs page, including: Avalanche, Maze Walkthrough, Pong, and Tic-Tac-To. The programs are all available for download in case anyone wants to try them out on their calculator.
15/04burr added a Wiki Conventions page that lays down some general guidelines about how to format page content. There's a similar Command Stub page for command pages.
13/04thornahawk and Xphoenix added some more information about the Math commands.
08/04burr started the Review Exercises page, which allows readers to test their comprehension and understanding of the information on the wiki.
30/03 — The Wiki Tour was started, providing a general overview of the wiki and giving beginners some direction about using the wiki.
26/03alexrudd began experimenting with internal page anchors, and has decided that we should try to integrate them into more pages.
25/03DarkerLine started working on the Statistics Commands. These commands are extremely useful for anybody who has to take a statistics class.
23/03burr updated the Contribute page with some guidelines to help beginners better use the wiki.
15/03Harrierfalcon added Number Functionality to Custom Text Input.
03/03burr started the Recursion page. Recursion is related to using subprograms to optimize a program, except the program calls itself instead of other programs.
21/02DarkerLine decided we should give each command its own individual page, so that all the relevant information about that command can be put on one page. Be sure to check out the Command Stub to see how the information is organized.
19/02burr started the Usability page. It offers some ideas to think about when designing a program, including preventing the user from hurting themselves and following the KISS principle.
16/02alexrudd started a Deck of Cards page that should be helpful to anyone who is wanting to learn how to manage the cards in a card game (such as Blackjack).

2006

08/11alexrudd and DarkerLine are promoted to admins, so they are now able to do all of the admin-related things for the wiki.
14/10burr started the Marketing page. It offers some solid suggestions on ways to market your programs to the community.
10/10burr started the Writing Program Documentation page. Check it out if you are wondering why documentation is important and what things your program documentation should include.
07/10 — Talks of merging the wiki with the Function Library forum occur, but they ultimately fall through because it is decided that the wiki already covers much of the same content and the forum quality isn't very good.
06/10burr started the Look-Up Tables page. Look-up tables are commonly used to increase the speed of programs when speed is the primary need in the program. This is especially true if graphics or user input are involved.
24/09burr started the Custom Text Input page. It shows a simple input routine, briefly explaining how custom text input works and how you can expand the functionality to suit your own purposes and needs.
23/09alexrudd updated the Program Protection page, further refining the different ways to protect a program. In addition, some good discussion about program protection and whether it is appropriate occurred over at the UTI TI-Basic forum.
23/09burr started the Program Clean Up page. After a program finishes running, it should clean up after itself. This involves restoring the respective screens, deleting variables, and some other things.
22/09burr started the Optimizations page. The page details the many different optimizations that you can do to a program, organizing them into relevant and related categories.
06/09 — The wiki is moved from Wikispaces to Wikidot for hosting because the look of the pages and editor is better, and it offers a lot more space for the wiki to grow and mature.
01/09 — TI-Basic Developer wiki is started by burr using the content from his TI-Basic Developer guide as the foundation for the wiki.

{$part4end}

lode_runner.gif

Program Summary

A quality version of the classic lode runner game.

Program Size

3,000 bytes

Uses Libraries?

No, it's pure TI-Basic

Calculator Compatibility

TI-83/84/+/SE

Author

SiCoDe (Brandon Green & Tim Parkin)

Download

loderunner.zip

Lode Runner is a classic puzzle game that involves collecting all of the coins a level by navigating through the ladders and platforms, as well as avoiding the enemies. This is the only TI-83 Basic lode runner game available, but it is a quality game nonetheless.

Like with some of the other popular SiCoDe games, this game utilizes the home screen scrolling made possible by the Output( command to display the levels. The Output( command has wordwrapping functionality built-in, in which any text that goes over the 16 characters of a row will be wrapped to the next row (and likewise with that row), and subsequently you can use a single Output( command to display an entire screen of text.

This functionality not only allows the text to be displayed very quickly — in fact, there is no faster way to display text in TI-Basic — but also very efficiently. What people were doing previously was actually just using several Output( commands, and then displaying each row of the screen separately. Obviously, this approach does not lend itself to making fast games, and so most games were rather slow.

The game uses the standard controls: arrow keys to move, CLEAR to quit, 2nd/ENTER to pause, along with MODE to make a hole in the ground to the left of the player and DEL to make a hole to the right. There are ten built-in levels, but the game also has support for external levels (what SiCoDe refers to as expansion sets).

The featured articles are articles that represent the best TI-Basic Developer has to offer. A featured article meets all of the following requirements:

  • Well-Written — It is easy to read, flows smoothly, and does not have any spelling or grammatical errors.
  • Complete — It includes everything about the topic, including theory, code examples, and screenshots, when appropriate.
  • References — If applicable, it lists the sources that were used in putting together the article.

To nominate an article for being featured, add it to the list below.

Featured Article Candidates:

Featured Articles

The ListPages module does not work recursively.

{$part1begin}

To add an article, move the current featured article from {$part2} to {$part3}, and add a new featured article to {$part2}. See the featured articles page to view the data on this page in a cosmetic format.

{$part1end}
{$part2begin}

When it comes to releasing a program, an inexperienced programmer may well release his work quietly and in an unassuming form, which people will simply glance over without stopping.

This tutorial will tell you how to avoid this, and make your program get all the attention it deserves. (more...)

{$part2end}
{$part3begin}

Piecewise expressions are a shortcut to handling conditions in math statements.

They can be used for turning an If block or several such blocks into a single line, creating much smaller and faster code. (more...)


A subprogram is a program called by another program to perform a particular task or function for the program.

When a task needs to be performed multiple times (such as displaying character data), you can make it into a separate subprogram.

The complete program is thus made up of multiple smaller, independent subprograms that work together with the main program. (more...)


Statistics is a mathematical science pertaining to the collection, analysis, interpretation or explanation, and presentation of data (source: Wikipedia).

The calculator has a series of commands devoted to statistics, including regression models, probability distributions, significance tests, and confidence intervals (more...)


Optimization is an extremely important part of the programming process, and involves making programs as fast and small as possible. Speed is important because TI-Basic is slow, while size is important because the calculator has limited memory.

It should be your goal, in virtually all cases, to make your programs as small and fast as possible. (more...)

{$part3end}

It's the goal of this site to eventually cover all information on TI-Basic programming for the 68k calculators. However, an excess of information can be overwhelming. So this page gives a suggested reading order (as well as necessary tidbits) so you don't get lost.

For Beginners

There are two alternatives for those who have just ventured into programming for these calculators. While you might want to just jump in, we have two tutorials that explain the basics of TI-Basic.

The first, the TI-Basic Starter Kit, teaches TI-Basic without assuming any previous programming experience. In fact, the very first page explains the basics of how a program works. After reading this tutorial carefully, you should be more than ready to handle the rest of this site.

The second tutorial is called TI-68k Programming for TI-83 Coders. As the name suggests, it is an introduction to programming for the 68k calculators, for those who have already gotten pretty good at programming for the TI-83 series calculators. This is a fairly common situation: often, people get a new calculator when taking a more advanced math class. This tutorial explains the differences between TI-83 and TI-68k programming, so that you're not confused by the new features.

Further Reading

At this point, you should be familiar with more than a few TI-Basic commands. It might be a good idea to just jump into the command index and click on commands that sound interesting — you can really improve your TI-Basic knowledge that way. Or, select a category from the Commands menu in the top navigation, and read about commands in a more general way.

Looking at code examples is also a good way to learn. Sample Programs and Technique Examples are a good place to find such example code. See the Routines page for several short routines to get simple things done in the best possible way.

Use the glossary whenever you come across a term you're not familiar with. If it's not there or the entry doesn't help, drop a note in the forums and (usually within a day) helpful people will explain it and hopefully improve the glossary as well, so no one else has the same trouble.

Writing a Program

Of course, the best way to learn these topics is to come up with a project of yourself (check the projects page if you have no ideas), and go through the steps as you're doing it:

  1. Look at Planning when you're thinking about how to approach the problem.
  2. Consider Commenting code when you're writing it.
  3. If bugs arise (and they most likely will), see the section on Debugging.
  4. When the program works, add Setup and Cleanup to it, and check the section on Usability.
  5. If the program is too slow (and maybe even when it's not), see Optimization and Code Timings for ways to improve it.
  6. Finally, see Releasing Your Program for how to earn TI-Basic programming fame by making the program public.

These are listed in the Writing Programs section of the side navigation menu.

Advanced Topics

The "Special Topics" section (in the side navigation menu) discusses some advanced issues in TI-68k programming. You should probably have a good grasp of programming before venturing into these pages, but they are worth reading. Give them a glance to see how much you can understand.

Each special topic is mostly a stand-alone page. Here are the relative difficulties of the pages:

Easy

  • Subprograms — an idea you should be familiar with by now.
  • Saving Data — almost as easy as just storing to a variable.
  • Assembly — I'm not saying writing assembly is easy, but learning about it sure is.

Intermediate

  • Sprites — a matter of learning several commands, and where to use them.
  • Animation — a natural second step from the above.
  • Dialogs — again, just learning a few commands.

Hard

  • Compression — if you wanted, you could get into some heavy theory with this.
  • System Variables — almost more useful as a reference tool than anything else.
  • Tokenization — not much practical use, but it's useful to understand how things work.
  • Cross-Compatibility — if only more people were aware of this…

Reference Material

The pages in the Reference section of the side menu are probably not ones you'd read for fun. Take a look at them at any time to see what they're all about, and then check back when you need to know more.

Now that you have learned the commands, design theory and game techniques, it's time to put that information to use. These project ideas are for programs that you should try to make to the given specifications, using whatever commands you need. Of course, the specifications aren't set in stone, so you don't have to include something if you don't want to.

In addition to following the specifications, try to make the programs as optimized as possible, and use good design when structuring them (i.e., don't use Goto when a loop is really what you should be using). If you can successfully make all of these programs, and have done a good job writing them, you can consider yourself a good programmer.

If you are having trouble making any of the programs, or you just want some input from other people, you can post in the forum. Before you do that, though, we encourage you to really try to create the programs and put some thought into them.

Phone Directory

Create a phone directory with these features:

  • Make a list of phone numbers, and also include the person(s) who own the phone number.
  • Display the phone numbers and person(s) on the screen.
  • Let the user sort through the phone numbers in ascending and descending order.
  • Let the user create, delete, and update the phone numbers and person(s).

Role-Playing Game (RPG)

Create an RPG with these features:

  • Use the graph screen for the interface.
  • Split the map into multiple pieces, displaying each piece when needed.
  • Create a theme for the RPG and base everything off of it.
  • Give the player a few weapons to attack enemies with.
  • Create AI enemies that the player can battle for experience points.
  • Make a couple bosses that the player has to defeat to adavance to the next level.
  • Upgrade the player weapons when set experience points are gained.

Snake

Create a snake game with these features:

  • Make a snake character that you can move around on the screen using the arrow keys.
  • Randomly display a piece of food on the screen for the snake to "eat".
  • Use collision detection to check if the food was eaten or the snake went off the screen.
  • If the snake goes over the screen boundaries, the snake is dead and the game is over.
  • Keep a highscore based on the highest amount of food the snake has eaten at one time.

BlackJack

Create a blackjack game with these features:

  • Use a graphical interface.
  • Have custom input for both players, alternating between players.
  • Implement all the rules of blackjack into the game.
  • Record the games won/lost by each player.

Hangman

Create a hangman game with these features:

  • Use a graphical interface.
  • Use custom input for both players.
  • Have one player choose a word, and the other player guess the word.
  • The guessing player gets ten chances to guess the word before they lose.
  • The guessing player selects a letter that they think is in the word. If the letter is there, then that letter is revealed and the player doesn't lose a chance.
  • If the letter is not there, the player loses one of their chances.
  • If the player guesses all the letters in the word, they win. If they run out of chances before they get the word, they lose.

The programs linked from this page are short programs meant to demonstrate the use of several programming techniques described elsewhere in this guide. For readers who learn better by example than by explanation, these programs are a great way to learn these techniques.

These programs have been fully optimized, except where this would interfere with readability. For example, the names of variables could easily be converted to single characters — this was deliberately left undone. The individual pages explain what would be done to finish the job of optimization.


A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | U | V

A

Argument
One of the values that a command acts on.
Array
A collection of numeric variables arranged in a list or matrix for processing by the calculator. Each element in an array is referenced by its index - position in the array.
ASCII
The American Standard Code of Information Interchange. It uses 1 byte (8 bits) to hold a character, and thus is limited to 256 different characters. The calculator uses a modified version of ASCII internally to store characters (see Character Codes), but the TI-Basic interpreter deals with tokens instead.
Assembly
The other programming language built-in to the TI graphing calculators, apart from TI-Basic. It is much more difficult to learn and program in, but at the same time it is much more powerful, and can be used to create very sophisticated games and programs. You can also compile C into an assembly program.

B

Binary
The two-digit (bit) number system based on 0 and 1, similar to the way the normal decimal system is based on the numbers 0-9. For example the number 10101 in binary represents 1*24+0*23+1*22+0*2+1, or 21 in decimal. To enter a number in binary on a TI-68k calculator, write 0b followed by the number.
Bit
A binary digit (0 or 1).
Branch
A departure from the sequential performance of program statements. An unconditional branch causes the calculator to jump to a specified place in the program each time the branching statement is encountered. A conditional branch transfers program control based on the result of some logical condition.
Breakpoint
A point in a program where program execution can be suspended, used when debugging the program. In TI-Basic, such breakpoints can be created with the Text command.
Bug
An error in a program (see also Debugging).
Byte
A string of eight bits. The calculator uses one byte of information to encode the letter "A", as well as most tokens. Bytes (or kilobytes - one kilobyte is 1024 bytes) are used to measure the amount of memory a program or variable takes up on the calculator.

C

C
A popular programming language on many platforms. Using TIGCC, C programs can be compiled to assembly for the TI-68k calculators.
Character
A letter, number, punctuation symbol, or special graphics symbol. They are encoded in ASCII format internally, but the TI-Basic interpreter uses tokens instead.
Clock cycle
The unit of time in a CPU. It is so small that even the most primitive assembly instructions take several clock cycles to run; the amount of clock cycles it takes for a single TI-Basic command can be in the millions.
Command
A word or token that tells the calculator to do something. Examples: RclPic, For, max(), etc. They are sometimes subdivided into functions and instructions
Concatenation
Joining two or more strings together to make a longer string. The ampersand — & — is the concatenation operator. For example, "TI-"&"Basic"="TI-Basic".
Condition
A logical expression that the calculator can evaluate to be true or false.
Constant
A specific number, list, matrix, or string that is given as a fixed value in the program (such as 9.024 or "Hello"), rather than contained in a variable.
CPU (Central Processing Unit)
The "brain" of the calculator, where the calculator controls the processing and execution of everything.
Cursor
A small, flashing square showing where a typed character will appear. A cursor (in the form of a crosshair) is also used on the graph screen to input a point from the user.

D

Data
Information, often numerical in form. When data is used by a calculator program, it can be hardcoded or softcoded.
Debugging
Fixing a program to remove bugs, or mistakes. There are many techniques for debugging, some universal, some specific to calculator programming.
Decimal
A base 10 number system using the symbols 0-9. It is the default number system used by the calculator.
Default
A standard characteristic or value which the calculator assumes without specification. For example, the RclPic displays a picture at the coordinate (0,0) by default (the top left corner). This can be overwritten with further arguments to specify the coordinate to display at.
Dialog
A message box displayed on the screen for input and output.

E

Execute
Another name for running a program or command.
Exponent
A number indicating the power to which a number or expression is to be raised, usually written at the right and above the number. For example, 26 = 2x2x2x2x2x2. In scientific notation, the power of ten which the mantissa is multiplied by to calculate the actual number.

F

Flash
The ROM/archive memory on the TI-68k calculators where applications are stored.
Floating point
The format used in TI-Basic for storing decimals. It uses scientific notation to display all numbers.
Flow Chart
A diagram of geometric shapes connected by arrows that show the progression of a program. Flow charts are handy for developing complicated programs and illustrating how programs work.
Function
The word Function has several meanings in the context of TI-Basic programming. It can mean a type of command that returns a value - such as gcd() or sin(). Or it can mean a type of user-defined program that returns a value.

G

Graphics
Any sort of visual display on the screen, such as graphs, patters, and drawings, both stationary and animated.

H

Hardcode
Hardcoded data is information used by the program that results from the logic of its commands. It is very easy for the program to read, but can be impossible to change.
Hardware
The circuit boards and other electronic parts which make up a calculator.
Hexadecimal
A base 16 number system using 16 symbols, 0-9 and A-F. It is used as a convenient shorthand way to express binary code, because every four bits of binary have a corresponding hexadecimal symbol. To enter a number in hexadecimal on a TI-68k calculator, write 0h followed by the number.

I

Index
A position in an array. In TI-Basic, arrays are indexed starting with 1 (so that the first element in a list is numbered 1, the second 2, and so on). In some other languages, they are indexed starting with 0.
Input
The means by which data is entered into the calculator by the user, primarily through the calculator's keys (though the link port is also a form of input).
Instruction
In the case of TI-Basic programming, this is often used to indicate a type of command that does not return a value, but stands alone: for example, Line, or Input. It is also sometimes used to describe commands in general.
Integer
A whole number, positive or negative (or 0). Usually in TI-Basic, a number is an integer by default, which means all of its digits are stored exactly. You can also use floating point numbers for approximate calculations with decimals.
Interpreter
The algorithm stored inside the calculator that runs a TI-Basic program by executing the appropriate system routines.
Iteration
One repetition of a loop. For certain commands, the calculator has an internal loop for which the total number of iterations is relevant, and affects accuracy.

K

Keypad
The panel of keys used to enter programs and data into the calculator.

L

List
A sequence of variables which can be accessed and modified by their position. In TI-Basic, lists can have any mix of variable types.
Loop
A group of one or more consecutive program lines which are performed repeatedly, either a specific number of times, or until a condition is met.

M

Mantissa
The basic numeric portion of a number expressed in scientific notation. In 3.264E + 4, the mantissa is 3.264.
Matrix
A two-dimensional grid of variables which can be accessed and modified by their position. In TI-Basic, lists can have any mix of variable types.
Memory
The two different places (RAM and ROM) where calculator programs and data are stored. All variables and programs take up part of memory to store, which makes the size of a program or variable very important.
MHz
The speed the calculator CPU runs at. It ranges from 10MHz to 16MHz on the TI-68k calculators. It's measured in millions of clock cycles per second.

N

Number system
A way of writing down a number. Two common systems used by people are the decimal (Arabic) system, and the Roman numeral system. The calculator uses the binary system internally, but the decimal system is what it usually displays.

O

Operator
A symbol used in calculations (numeric operators) or in relationship comparisons (related operations). The math operators are +, -, *, /, ^. The relational operators are >, <, =, ≥, ≤, ≠. The logic operators are and, or, xor, not.
Optimization
The process of improving the running time, length, or memory usage of a program.
Output
Information sent from the calculator, e.g. graphics on the screen. Also, the means by which data leaves the calculator, through either the link cable, graph link, or USB cable.
OS (Operating System)
The internal program that runs the calculator and includes all the functionality needed to use the calculator.

P

Program
The list of instructions that tells the calculator what to do to perform a task.
Programmer
A person who writes programs.
Programming Language
Numeric or alphabetic commands which the calculator can understand, and execute.

R

RAM (Random Access Memory)
A temporary memory, i.e. one in which data is stored so long as electrical power is applied. Data in RAM can be accessed or changed and is lost if the batteries are removed from the calculator.
Recursion
A program that calls itself as a subroutine (or a function that's defined in terms of itself). See recursion.
ROM (Read Only Memory)
Certain instructions for the calculator are permanently stored in ROM and can be accessed but cannot be changed. Data in ROM is not lost if batteries are removed.

S

Scientific Notation
A method of expressing very large or very small numbers by using a base number (mantissa) times ten raised to some power (exponent).
Scroll
Shifting part of the screen to give the illusion of seeing only part of an image larger than the screen.
Softcode
Softcoded data is information stored in an array at the beginning of the program, and read from it later. It is usually slower to read than hardcoded data, but the advantage is that the same code can often used for different data stored in the same way.
Sprite
A small image which is moved around the screen using code and/or repeated multiple times on the screen.
Statement
A single line of a program containing a single instruction such as Text, RclPic, max(), etc. Usually synonymous with command.
String
A variable type that stores text as a series of characters.
Subprogram
A program segment which can be used more than once during the execution of a program, such as a complex set of calculations or a print routine. You can make subprograms using the Define command.

T

TI (Texas Instruments)
The makers of the TI graphing calculators. In addition to graphing calculators, they also make a large assortment of other electronic devices.
TI-68k
The unofficial name for the TI calculators that have a 68k processor: the TI-89, TI-89 Titanium, TI-92, TI-92 Plus, and Voyage 200. These are the calculators described in this section of TI|BD.
TI-Basic
The unofficial name of the programming language found on TI calculators.
Token
A single instruction or symbol in tokenized TI-Basic that takes up 1 to 3 bytes and is used to encode TI-Basic programs.

U

User
When talking about the effect of a program or command, it is the person running the program or command on his/her calculator.

V

Variable
A name given to a value which may vary during program execution. A variable is a memory location where values can be replaced by new values during program execution.

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.