Disaster

Programming is a very demanding task, and it requires a special kind of person. Most people who try their hand at programming decide that it is either too much work, too boring, or a combination thereof. Fortunately, these people are the ones you don't want to be programming, so it all works out.

Assuming you are not one of those people, there are a few key indicators that tell you whether you are cut out to be a programmer. The first indicator is your mental aptitude. Do you enjoy solving problems and puzzles — for example, a complex math problem — and do you like the more technical things? Programming at its core is about solving problems and figuring things out, so if you don't have the right mental aptitude, then programming probably isn't for you.

Related to the first indicator, the second indicator is your willingness to work through difficult problems and figure things out. This skill requires a very dedicated, almost obsessive person who is transfixed on the problem. Even if you don't know something, you need to be comfortable with that feeling, and still be able to rationally research a solution to the problem.

The third indicator is your passion for learning and growing. Do you spend hours at a time reading and researching in books and documentation? When you see high-quality programs and games, does that make you want to dissect the program to find out how it works? Passion is often what drives you to keep pushing to the next level, and without it, you will almost be guaranteed to just get tired and give up.

All three of these indicators — aptitude, persistence, and passion — are vitally important to any successful programmer. We all face challenges and difficulties, but we overcome them using those different things. If you only have two of the three indicators, you can still be a decent programmer, but you won't be as complete a programmer as you could be.

You've just completed your first major program. It is a TI-83+ TI-Basic rendition of the classic game, Guess-The-Number. You've spent what seems like hours making it. You know that it isn't anything fancy, but you are proud of it, and you want to release it to the public. So, you just write up some quick documentation, and it's ready for release. Or, so you believe… The truth is that there is a lot more to releasing a program than that.

On a calculator with limited memory and speed, people only want to keep something if it is worth it. If your game is original, fun and optimized, then people will want to keep it on their calculators. The more likely scenario, however, is that there are several similar programs already released, and chances are that those programs are just like yours: same graphics, same gameplay, and same slow load-up time. You have to ask yourself then — What makes my program different from the competition? If you are honest with yourself, you will have to say there is nothing different between the two!

Making it Stand Out

If you want your program to stand out from the other duplicate programs, you will need to make it apparent to the user. Users often see several different variants to the same program, and it becomes extremely hard to separate the good ones from the bad ones. Making your program stand out not only includes making your program original and fun, but also optimized.

The goal of this guide is not to show you how to make your program original and fun. Just let your creativity run wild, and you can come up with an endless supply of ideas. After that, you just start programming those ideas into your program. If you have trouble coming up with ideas on your own, the other thing you can do is look at programs on the Internet. There are countless online programs just waiting to be ported to the TI-83+ calculator. Of course, you will have to adapt them to the smaller screen.

What I am going to discuss in this guide is how you can take your program and transform it into its extreme form. What I mean by extreme is making your program as optimized as possible. You can define an optimized program as a program that is both small and fast, efficient as possible. Ideally, all of the programs you make should be optimized; it should be the standard.

For demonstration purposes, we are going to use the game that I mentioned above: guess-the-number. We will go through all of the optimization steps, changing the game accordingly. The final result will be an extreme version of guess-the-number.

The Original Code

Below is the code of the original version of the guess-the-number game. It is a 1-Player game, with the person having to guess the number until they finally get it. The game is played on the home screen. It features a high score that keeps track of the lowest amount of guesses it takes the person to get the number. It also features a counter that tracks how many of your guesses are high and how many of them are low. It will even tell you which one won. The game is programmed the way a beginner would program it. It is your standard TI-Basic guess-the-number game found on ticalc.org.

(NOTE: This game has no optimizations done to it in any way.)

:ClrHome
:0→T:0→A:0→C
:randInt(1,10000)→B
:1→dim(∟HIGH)
:If ∟HIGH(1)=0
:20→∟HIGH(1)
:Disp "Guess The Number"
:Disp "Range Is 1-10000"
:Lbl AA
:Input "Guess: ",A
:T+1→T
:If A>B or A<B
:Then
:If A>B
:Then
:Disp "Too High!"
:C+1→C
:End
:If A<B
:Then
:Disp "Too Low!"
:C-1→C
:End
:Else
:Disp "","Good Guess!"
:If ∟HIGH(1)>T
:Then
:T→∟HIGH(1)
:Disp "New Record!"
:End
:If C>0
:Then
:Disp "High Wins!"
:End
:If C<0
:Then
:Disp "Low Wins!"
:End
:Disp "It Took You",T
:Disp "Tries!"
:Pause
:ClrHome
:Stop
:End
:Goto AA

Basic optimizations

When you are starting the process of optimizing your programs, you want to begin with the basic optimizations. One of the first things that you can do is remove closing parentheses, braces, and quotation marks. These things are unnecessary in most cases. The one rare instance where you would want to keep the closing parentheses is when you are dealing with order of operations. For example, when the command is in a list of arguments for an expression or a function.

In our guess-the-number game, there exists several places where we can remove the closing parentheses, braces, and quotation marks. You can remove the closing parentheses on the randInt(1,10000). The store (→) statement closes it, so no closing parentheses is needed. You can also remove the closing parentheses on the dim(∟HIGH) statement and the two ∟HIGH(1) statements.

If you look at the statement If ∟HIGH(1)=0, you can see that it contains the potential to have its closing parentheses removed. You need to first rearrange the statement, switching the ∟HIGH(1) with the 0. The closing parentheses can now be removed, and the result is 0=∟HIGH(1. You can do the same thing with the If ∟HIGH(1)<T statement.

The last thing that you can remove is all of the closing quotation marks on the Disp commands. If you reached the fifth and second to last Disp commands you probably noticed that they have a different syntax than the other Disp commands.

One of the unique attributes of the Disp command is that you can link them together. You just put a comma after the quotation marks for every Disp command that you want to link. You can link both text and variables. In our case, we are linking a variable to text. Just remember that the Disp commands inside the chain need both of their quotation marks. Linking Disp statements won't save you any space, though. In fact, if you hook all of your Disp commands together it can become hard to read the code. It is only recommended when it doesn't hinder readability.

One other thing that you can remove is multiplication signs (*). The calculator does implicit multiplication, so they are never needed. Our program doesn't have any multiplication in it, so this optimization isn't applicable.

Besides removing closing parentheses, braces and quotation marks, and multiplication signs, you can also change all of your text to uppercase letters. Making your text look nice comes with a price. Lowercase letters are two bytes each instead of one byte like uppercase letters. This can really be costly if your program has a lot of text in it. You can't even store to lowercase letters, either. Whether you use them or not is your choice. We aren't going to use them in our guess-the-number game, though.

You also want to make sure to keep your label and list names as short as possible. Ideally, you only want to make them one character in length. This is not always the case, however. When you are first programming your program it helps to know what data your lists hold, and you can do that by using longer list names. When you release your program, though, you want to make sure to shorten them. Applying this optimization to our game, we can change ∟HIGH to ∟H and Lbl AA to Lbl A. It is now 4 bytes smaller for each occurance.

:ClrHome
:0→T:0→A:0→C
:randInt(1,10000→B
:1→dim(∟H
:If 0=∟H(1
:20→∟H(1
:Disp "GUESS THE NUMBER
:Disp "RANGE IS 1-10000
:Lbl A
:Input "GUESS: ",A
:T+1→T
:If A>B or A<B
:Then
:If A>B
:Then
:Disp "TOO HIGH!
:C+1→C
:End
:If A<B
:Then
:Disp "TOO LOW!
:C-1→C
:End
:Else
:Disp "","GOOD GUESS!
:If T<∟H(1
:Then
:T→∟H(1
:Disp "NEW RECORD!
:End
:If C>0
:Then
:Disp "HIGH WINS!
:End
:If C<0
:Then
:Disp "LOW WINS!
:End
:Disp "IT TOOK YOU",T
:Disp "TRIES!
:Pause
:ClrHome
:Stop
:End
:Goto A

The next optimization that we will employ is using the calculator's built-in keys, characters and functions. Whether you know it or not, the calculator contains several useful keys, characters and functions just waiting to be used. For example, you can use the e^( key rather than typing out e^. This is the same for the squared-sign ( 2 ) key, the cubed-sign ( 3 ) character, the 10^( key, the inverse-sign ( -1 ) key, and the E exponent.

The E character is used mainly for scientific notation. It is the only character that our game can use. In our code there exists one instance where we have the number 10000. Using the E, we can replace 10000 with E4.

In addition to learning the calculator's built-in keys, characters and functions, it is also to your benefit to learn the syntax of the commands and their arguments. Several commands have optional arguments that you will only learn about if you read the manual. One such command is Pause. The Pause command can take either a variable or text for its optional argument. What it allows you to do is take text or a variable from the last Disp command and put it as the optional argument. This allows you to delete the last Disp command. Doing this shrinks our program by one byte.

If you start using the manual when you are programming, it will really benefit you. You can use it for whenever you have a question about some command or function. In fact, you should use it as much as you possibly can. Read it until it's in your brain.

When dealing with variables, there's a shortcut to setting the variable to zero. Instead of 0→X, you can use DelVar X. The calculator automatically sets the variable to zero the next time that it is used. In addition, the DelVar command doesn't need a newline/colon following the variable name. This allows you to make chains of variables, with the last variable having the statement from the next line coming immediately after it. In terms of our game, we can use this optimization at the beginning. We have three variables that we set to zero at the game's start. We can use DelVar with each of them, and we can attach the randInt(1,E4→B statement to the end. This eliminates the line that randInt(1,E4→B is on.

:ClrHome
:DelVar TDelVar ADelVar CrandInt(1,E4→B
:1→dim(∟H
:If 0=∟H(1
:20→∟H(1
:Disp "GUESS THE NUMBER
:Disp "RANGE IS 1-10000
:Lbl A
:Input "GUESS: ",A
:T+1→T
:If A>B or A<B
:Then
:If A>B
:Then
:Disp "TOO HIGH!
:C+1→C
:End
:If A<B
:Then
:Disp "TOO LOW!
:C-1→C
:End
:Else
:Disp "","GOOD GUESS!
:If T<∟H(1
:Then
:T→∟H(1
:Disp "NEW RECORD!
:End
:If C>0
:Then
:Disp "HIGH WINS!
:End
:If C<0
:Then
:Disp "LOW WINS!
:End
:Disp "IT TOOK YOU",T
:Pause "TRIES!
:ClrHome
:Stop
:End
:Goto A

Using the calculator's built-in keys, characters and functions only saved us two bytes. If you add in using the Pause command's optional argument and deleting the last Disp command, as well as changing the variable storages to DelVar and moving the randInt( to the end, we saved 7 bytes total. The memory saved may not seem like much, but it is still good practice to always incorporate as many optimizations in your programs as possible.

We now move on to the reorganization and elimination optimizations. You want to try to reorganize your code to eliminate redundant or unnecessary commands or text. If you notice in our game, it doesn't matter what the A variable's initial value is. The user's input will change the A variable's value before any of the conditionals, so we can get rid of the DelVar A command without the game being affected.

One of the first places to look for reorganizations is conditionals. When your conditionals are in the form If X≠0 or If X=0, they can be replaced with If X and If not(X, respectively. They mean the same thing because the calculator checks if X isn't zero in both of the first conditionals and if X is zero in both of the second conditionals. Our game has an If 0=∟H(1 conditional, which can become If not(∟H(1.

Conditionals that have a Then and an End statement can also be optimized. If the conditional only has one nested line, you don't need to include the Then and the End. This optimization is applicable in our game for two of our conditionals. We can apply it to the If C>0 conditional and the If C<0 one.

If the conditionals are opposites and they have two or more nested lines you would not want to remove both of the Then and End statements. Instead, you can remove the first End statement, the second conditional, and the second Then statement, and replace them with an Else statement placed after the nested lines of content of the first conditional. The reason is that only one of those conditionals can be true at any time, so we don't need to do two checks. We can do this with the If A>B conditional and the If A<B conditional. This makes the conditionals five bytes smaller.

The last conditional that we can optimize is If A>B or If A<B. This is a compound conditional, where multiple conditions have to be met in order for it to be true. The goal of the game is to have A=B. The opposite of this condition is A≠B. Looking at our compound conditional, we can see that it really means when A isn't equal to B. It can therefore be replaced with the If A≠B conditional.

The last elimination optimization is not really noticeable unless you are looking for it. Notice how I mentioned above about eliminating redundant or unnecessary commands or text? Well, if you look at the two text phrases "Too High!" and "Too Low!", you can see that they can be replaced with the shorter text phrases "Lower!" and "Higher!". Whenever you are writing text, you should always look for ways to reword or shorten it.

:ClrHome
:DelVar TDelVar CrandInt(1,E4→B
:1→dim(∟H
:If not(∟H(1
:20→∟H(1
:Disp "GUESS THE NUMBER
:Disp "RANGE IS 1-10000
:Lbl A
:Input "GUESS: ",A
:T+1→T
:If A≠B
:Then
:If A>B
:Then
:Disp "LOWER!
:C+1→C
:Else
:Disp "HIGHER!
:C-1→C
:End
:Else
:Disp "","GOOD GUESS!
:If T<∟H(1
:Then
:T→∟H(1
:Disp "NEW RECORD!
:End
:If C>0
:Disp "HIGH WINS!
:If C<0
:Disp "LOW WINS!
:Disp "IT TOOK YOU",T
:Pause "TRIES!
:ClrHome
:Stop
:End
:Goto A

We can further optimize our conditionals by making use of the Ans variable. The Ans variable is a temporary variable that changes every time you store something. It can hold any variable or any text. It is the fastest variable on the calculator. It is mostly useful when you are just manipulating one variable.

In our case, we will use it for holding text. Looking at both text phrases, High Wins! and Low Wins!, we see that they share two common elements: the word "Wins" and an exclamation point. The only thing that changes is the High and Low text. We can take advantage of this, and put the text in the Ans variable. If you noticed, the text phrases Lower! and Higher! also share two common elements: the letters "er" and an exclamation point. The Ans variable won't work here, though, because they are each contained within their respective conditionals. We will come back to them later.

To store anything in the Ans variable you just have to put it on a line by itself. We will put "High on the first line, the If C<0 conditional on the second line, and "Low on the third line. How this works is the Ans variable will contain the text "High, but if the If C<0 conditional is true the text "Low will be in the Ans variable instead. In order to complete the optimization, we will have to get rid of the first Disp statement and change the second one. Our Disp statement will now look like this: Disp Ans+" Wins!. The Wins and the ! are constant, while the Ans variable will change depending on the value of the If C<0 conditional. We will also have to get rid of the End after the Disp statement. Try to use the Ans variable as much as possible.

Using the Ans variable has an unexpected consequence on our If C<0 conditional. What if C is neither greater than zero or less than zero? High Wins! will be displayed on the screen because it is the text that we first stored into Ans. To fix this problem, we need to put an If C≠0 conditional on the line before the Disp statement. This can further be optimized to If C because of the optimization mentioned 8 paragraphs above.

Another way that you can optimize your program is aesthetically. If you run our game, you will notice that Done is displayed on the screen after you exit. This doesn't look very good. To get rid of the Done, you need to have an Output( statement as the last displaying command; there can be no Disp or ClrHome command after it. The Output command does not need to be the last line of code, though. You can do the same thing with erasing the run indicator on the graph screen by using Text(90,0," . This makes your program look very professional.

:ClrHome
:DelVar TDelVar CrandInt(1,E4→B
:1→dim(∟H
:If not(∟H(1
:20→∟H(1
:Disp "GUESS THE NUMBER
:Disp "RANGE IS 1-10000
:Lbl A
:Input "GUESS: ",A
:T+1→T
:If A≠B
:Then
:If A>B
:Then
:Disp "LOWER!
:C+1→C
:Else
:Disp "HIGHER!
:C-1→C
:End
:Else
:Disp "","GOOD GUESS!
:If T<∟H(1
:Then
:T→∟H(1
:Disp "NEW RECORD!
:End
:"HIGH
:If C<0
:"LOW
:If C
:Disp Ans+" WINS!
:Disp "IT TOOK YOU",T
:Pause "TRIES!
:ClrHome
:Output(1,1,"
:Stop
:End
:Goto A

Our program now has all of the basic optimizations done to it. This is where most people would stop with optimizations, and just release their program as is. The truth is that there are more optimizations to be done. Granted, these optimizations require more work than we put into the basic optimizations. It's worth the work, though.

Advanced optimizations

Advanced optimizations involve changing your program in radical ways: changing conditionals into their Boolean form, rearranging and restructuring loops, and even completely redoing your program, if necessary. They can change the whole design and complexity of your code.

Changing conditionals into their Boolean form requires knowledge of equality tests. Putting X=3 into your calculator returns either 1 or 0 depending on the value of X. We can use this same principle in our conditionals. Say we have If X=3:Y+1→Y. We can get rid of the If statement and put parentheses around the X=3 statement and then put it in the place of the 1 — Y+(X=3)→Y. The reason that this works is that when the X=3 statement is evaluated, and it is true it will return 1 and then add that value to Y. You can also keep the 1 and put it in front of the X=3 statement. Or, if you want to, you can change the 1 into another number. It will just add that number to Y instead.

We can use this optimization in our game. It may not seem apparent, but every time the calculator goes through the loop and checks if A>B, it adds 1 to C if the conditional is true. It does the exact opposite when it checks if A<B: it subtracts 1 from C if the conditional is true. Noticing this, we can combine the two C conditionals into one by using their Boolean form. When A>B is true C is incremented by 1, so we should have that as one of the conditions. In similar fashion, when A<B is true C is decremented by 1, so we should have that as one of the conditions. Our conditional now looks like C+(A>B)-(A<B→C. This is as optimized as it can get. You will have to move it outside next to the T+1→T statement now because it gets updated every time through the loop.

Changing the conditional into its Boolean form has now allowed us to optimize the two conditionals that we couldn't optimize before. We can repeat the same process that we did with the High/Low Wins! conditions. Our Disp statement will be Disp Ans+"er!.

In addition to changing your conditionals into their Boolean form, you also want to make your loops as compact as possible. You only want your loops to contain things that are dynamic, things that change within the loop. If something only happens once, then you should put it outside the loop. In addition to things that don't change, you want to cut down on the number of storages you make inside your loops, keeping in mind how often certain variables are used and what they are used for. Compacting your loops may take some ingenuity on your part. Ultimately your goal is to make your loops only have the necessary commands inside of them, and nothing more.

If you look at our guess-the-number game, you can see that the loop in it could indeed be made more compact. Every time through the loop, the calculator has to pass through the end game text. This text is only displayed once, when you guess the number. It, therefore, should be placed outside the loop.

After moving the end game text to the end of the code, we now need a way to get to it. We will have to make a respective label (Lbl B) for the text, and put in a conditional (If A=B) that checks to see if the number is guessed, sending the calculator to that label if it is. In addition, we need to remove the If A≠B conditional because it no longer applies. We also need to add a conditional before the Disp Ans+"er! statement, to check if the user hasn't guessed the number yet. Doing this doesn't make the code any smaller, but it does increase the speed of the loop.

Now that the end game text is at the end of the code, we no longer need the Stop command. If possible, it is always preferred to have your programs exit naturally. If you can't make your programs exit naturally, use the Return command instead of the Stop command. The Return command returns the user to the program that they called their current program from, while the Stop command exits the program and returns the user to the home screen. This is usually not want is desired by those that use your program.

:ClrHome
:DelVar TDelVar CrandInt(1,E4→B
:1→dim(∟H
:If not(∟H(1
:20→∟H(1
:Disp "GUESS THE NUMBER
:Disp "RANGE IS 1-10000
:Lbl A
:Input "GUESS: ",A
:T+1→T
:C+(A>B)-(A<B→C
:"LOW
:If A<B
:"HIGH
:If A≠B
:Disp Ans+"ER!
:If A=B
:Goto B
:Goto A
:Lbl B
:Disp "","GOOD GUESS!
:If T<∟H(1
:Then
:T→∟H(1
:Disp "NEW RECORD!
:End
:"HIGH
:If C<0
:"LOW
:If C
:Disp Ans+" WINS!
:Disp "IT TOOK YOU",T
:Pause "TRIES!
:ClrHome
:Output(1,1,"

In addition to making your loops compact, you also want to make sure that you are using the right looping structure. Using Goto/Lbls is not an efficient looping structure because when the calculator sees a Goto it notes the label and proceeds to search for it from top to bottom in your code. This can really be slow if the label is deep within the program. Using Goto/Lbls also has the tendency to make your code harder to follow when you are debugging or when you want to change something. It can make your code a real mess.

The other major reason why you want to avoid using Goto/Lbls is because, if used incorrectly, it can lead to memory leaks. A memory leak is where you don't properly exit a loop. For example, if you have a While loop that you exit out of by using Goto, the calculator still has the respective End for that While loop in its stack. If you do this enough times, the calculator will run out of memory — ERROR:MEMORY.

The recommended loops that you should use instead are Repeat, While, and For. These three looping structures should cover all of the looping that you will need to do. Repeat and While loops are best used when you don't know how many times the loop will be gone through, whereas For loops are best used when you know the specific amount.

You can use Repeat or While loops, but Repeat loops are the recommended loops. The main advantage of using a Repeat loop is that you don't have to set the initial value of the variable in the conditional. The reason is that Repeat loops are gone through at least once whereas While loops will not be gone through at all if the variable in the conditional is the desired value before the first run through. There is no speed difference between Repeat loops and While loops, though.

The way that this applies to our program is that we currently use two Goto/Lbls. We can optimize our program by eliminating the Goto/Lbls and replacing them with a Repeat loop. The loop in our game repeats until the user finally guesses the number. This tells us that A=B should be the conditional next to the Repeat loop. Doing this makes the game smaller and also considerably faster.

:ClrHome
:DelVar TDelVar CrandInt(1,E4→B
:1→dim(∟H
:If not(∟H(1
:20→∟H(1
:Disp "GUESS THE NUMBER
:Disp "RANGE IS 1-10000
:Repeat A=B
:Input "GUESS: ",A
:T+1→T
:C+(A>B)-(A<B→C
:"LOW
:If A<B
:"HIGH
:If A≠B
:Disp Ans+"ER!
:End
:Disp "","GOOD GUESS!
:If T<∟H(1
:Then
:T→∟H(1
:Disp "NEW RECORD!
:End
:"HIGH
:If C<0
:"LOW
:If C
:Disp Ans+" WINS!
:Disp "IT TOOK YOU",T
:Pause "TRIES!
:ClrHome
:Output(1,1,"

Our guess-the-number program is now optimized as much as possible. We have gone through the basic optimizations as well as the advanced optimizations. Sometimes even doing all of these optimizations is not enough, though.

The final optimization

If you are still not satisfied with your program, the final thing that you can do is completely rewrite it. This is usually the last resort because it takes the most amount of work to do. In addition, rewriting your program means that you will have to repeat both of the optimization steps over again.

What you should do during the rewriting process is break down your program into its basic parts, and think about different ways that you can restructure them. One of the most typical problems is a faulty algorithm. The algorithm was not fully thought out or it doesn't work together with the other parts of the program the way it should. You need to go back to the design phase then and rework the algorithm.

Conclusion

Once you have gone through your program and optimized it to the point where you feel confident releasing it to the public, you can then do so. Make sure to create good documentation for it, though.

Documentation is just as important as the program itself. The user wants to know how the program works, the stats of the program, and any other things about the program that might be valuable to know. Why go through all the work of creating a good, optimized program, and then not bother creating good documentation to go with it? Optimizing your program does not guarantee that your program will be successful. Good documentation along with an optimized program does increase the chances, though.

Well, I hope that this guide has helped you with your current program or a program that you have planned for the future. Remember that these are just suggestions on ways to optimize your program; it is your choice whether you follow them. Just know that the person that uses your program will be looking for a professional quality program, so you want to make sure to deliver it!

Routine Summary

Scrolls a string across one line, in marquee fashion, on the home screen.

Inputs

Str1 - the text to be scrolled
A,B - the Output( coordinates for the text
N - the number of characters to display at a time

Outputs

None

Variables Used

Str1, A, B, N, Ans

Calculator Compatibility

TI-83/84/+/SE

Author

Weregoose

URL: United TI

Download

marquee.zip

:Str1
:Repeat getKey
:Output(A,B,sub(Ans,1,N
:sub(Ans,2,length(Ans)-1)+sub(Ans,1,1
:If dim(rand(4
:End

By leaving Str1 by itself on one line, we store it to Ans, which will be easier to work with. Then, the Repeat getKey loop will display the marquee until a key — any key — is pressed.

Output(A,B,sub(Ans,1,N will display N characters of Str1 at A,B. Then, the next line will rotate Str1, so that the next time we're at this point in the loop, the string shifts one character.

Finally, If dim(rand(4 is a clever way of delaying the marquee, so it doesn't scroll too fast. rand(4 generates a list of 4 random numbers, which is a slightly time-consuming process. If dim( is just a way of wrapping this list so it doesn't change Ans. Since dim(rand(4 is always 4, the If statement will always be true, so we don't have to worry about the next line being skipped. By changing 4 to a lower or higher number, you can make the marquee go faster or slower, respectively.

Error Conditions

  • ERR:INVALID DIM is thrown if the length N is longer than the number of characters in Str1.

Routine Summary

Displays text on several lines on the graph screen.

Inputs

Str1 - text to display
A - starting row
B - starting column

Outputs

None

Variables Used

Str1, A, B, C, Ans

Calculator Compatibility

TI-83/84/+/SE

Download

wordwrap.zip

:1→C
:For(A,A,57,6
:inString(Str1,"/",Ans
:Text(A,B,sub(Str1,C,Ans-C
:If Ans=length(Str1:57→A
:Ans+1→C
:End

This routine displays a string on the graph screen, with line breaks after every slash "/" character. The routine requires there to be a slash at the end of the string (so, a sample string would be "THIS TEXT IS TOO LONG TO/DISPLAY ON ONE LINE/").

The row and column (A and B) inputs determine the upper and left boundaries of the text. You determine the right boundary by where you put the slash characters. The lower boundary is 57, hardcoded into the routine (this is the lowest that text can be displayed), but you could change this if you wanted a different boundary.

The variable C is used for an index inside Str1, that tells us which character we're currently on. We're starting at the beginning of the string, so we store 1 to C.

The For( loop will increment A by 6 each time we display a line (small font characters are 6 pixels tall). We start at the current value of A, and end at 57 because beyond that, Text( will throw a domain error.

Now, we search for the next slash "/" character using the inString( command. Then, using Text(, we display the line between C and the "/", not including the slash itself. Ans+1→C will move the C index to the next character after the slash.

The line If Ans=length(Str1:57→A will end the loop early as soon as we reach the end of the string. This command can modify Ans, which would be bad, but it only does so when we're ready to exit anyway — at that point, we won't be needing Ans anymore.

Error Conditions

  • ERR:INVALID DIM is thrown if Str1 is improperly formatted (check for the backslash at the end).
  • ERR:DOMAIN is thrown if text goes off the screen. This shouldn't happen unless B is very close to the right edge, if A or B are negative, or if the calculator is in Horiz mode (in which case, replace 57 with 25).

Related Routines

Routine Summary

Highlights text, displaying it in white on a black background.

Inputs

Str1 - text to be displayed
A - row coordinate of the text
B - column coordinate of the text
W - pixel width of the text

Outputs

None

Variables Used

Str1, A, B, C, W

Calculator Compatibility

TI-83/84/+/SE

Download

highlighttext.zip

:Text(A,B,Str1
:For(A,A,A+6
:For(C,B-1,B+W
:Pxl-Change(A,C
:End:End

First, we display the string using Text( on the graph screen. This displayed it normally, using black on white. To switch it to white on black, we need to flip the pixels from white to black and black to white — this can be done using Pxl-Change(. We chose the pixel command over the point command for two reasons: first, it is slightly faster, and second, it uses the same coordinate system as Text( — pixels (if we used Pt-Change, we'd need to convert from pixels to points to be sure of drawing in the same location).

We loop A from above to below the text, and C from just before the text to immediately after it. Note that because of the way the For( loop works — it saves the lower and upper bound before doing the loop — we can reuse the variable A. But we can't reuse B in the same way in the second For( loop, because the loop is done multiple times — it would work correctly the first time, but then B would have changed for the second.

Since Text( uses variable-width font, we need the W variable to tell us how long the string is in pixels. For uppercase letters, the width is 4 pixels; for spaces, the width is 1 pixel, and for lowercase letters, the width varies from 2 to 6 pixels.

Because Pxl-Change( must not go off the screen, check to see that the string fits on the screen entirely (with a border of 1 pixel around it) before displaying it.

Error Conditions

  • ERR:DOMAIN is thrown if the string does not fit on the screen entirely.

Related Routines

The cheat sheet is a basic list of the programming commands found in the PRGM menu while programming. Each command includes a brief summary, along with its syntax(s) and specific menu location. Click on the title of each box to see a more detailed description.

If

Checks if a condition is true, and if it is, runs an optional statement or group of statements.

Command Syntax

If condition
statement

If condition
Then
one or more statements
End

If condition
Then
statement(s) to run if condition is true
Else
statement(s) to run otherwise
End

Menu Location

  1. PRGM to enter the PRGM menu
  2. ENTER or 1 to choose If
End

Indicates the end of a block of statements.

Command Syntax

If condition
Then
statement(s)
End

While condition
statement(s)
End

Repeat condition
statement(s)
End

For(variable,start,end[,step])
statement(s)
End

Menu Location

  1. PRGM to enter the PRGM menu
  2. 8 to choose Pause, or use arrows
For(

Executes some commands many times, with a variable increasing from start to end by step, with the default value step=1.

Command Syntax

For(variable,start,end[,step])
statement(s)
End

Menu Location

  1. PRGM to enter the PRGM menu
  2. 4 to choose For(, or use arrows
  3. 7 to choose End, or use arrows
While

Loops through a block of code while the condition is true.

Command Syntax

While condition
statement(s)
End

Menu Location

  1. PRGM to enter the PRGM menu
  2. 5 to choose While, or use arrows
  3. 7 to choose End, or use arrows
Repeat

Loops through a block of code until the condition is true. Always loops at least once.

Command Syntax

Repeat condition
statement(s)
End

Menu Location

  1. PRGM to enter the PRGM menu
  2. 6 to choose Repeat, or use arrows
  3. 7 to choose End, or use arrows
Lbl

Defines a label for a particular Goto or Menu( to jump to.

Command Syntax

Lbl name

Menu Location

  1. PRGM to enter the PRGM menu
  2. 9 to choose Lbl, or use arrows
Goto

Jumps to the Lbl instruction with the specified name, and continues running the program from there.

Command Syntax

Goto name

Lbl name

Menu Location

  1. PRGM to enter the PRGM menu
  2. 0 to choose Goto, or use arrows
  3. 9 to choose Lbl, or use arrows
prgm

Calls another program from within a program, with program execution moving to that program.

Command Syntax

prgmNAME

Menu Location

  1. PRGM to enter the PRGM menu
  2. LEFT to enter the EXEC submenu
  3. Select a program
IS>(

Increments a variable by one and skips the next command if the variable is greater than the value.

Command Syntax

IS>(variable,value)

Menu Location

  1. PRGM to enter the PRGM menu
  2. A to choose IS>(, or use arrows
DS<(

Decrements a variable by one and skips the next command if the variable is less than the value.

Command Syntax

DS<(variable,value)

Menu Location

  1. PRGM to enter the PRGM menu
  2. ALPHA MATH to choose DS<(, or use arrows
Return

Stops the program and returns the user to the home screen. If the program is a subprogram, however, it just stops the subprogram and returns program execution to the parent program.

Command Syntax

Return

Menu Location

  1. PRGM to enter the PRGM menu
  2. ALPHA SIN to choose Return, or use arrows
Stop

Completely stops the current program and any parent programs.

Command Syntax

Stop

Menu Location

  1. PRGM to enter the program menu
  2. ALPHA F to choose Stop, or use arrows
DelVar

Deletes a variable from memory.

Command Syntax

DelVar variable

Menu Location

  1. PRGM to enter the PRGM menu
  2. ALPHA TAN to choose DelVar, or use arrows
GraphStyle(

Sets the graphing style of a graphing equation in the current mode.

Command Syntax

GraphStyle(equation #, style #)

Menu Location

  1. PRGM to access the programming menu
  2. ALPHA H to select GraphStyle(, or use arrows
DispGraph

Displays the graph screen.

Command Syntax

DispGraph

Menu Location

  1. PRGM to access the program menu
  2. RIGHT to access the I/O submenu
  3. 4 to select DispGraph, or use arrows
DispTable

Displays the table screen.

Command Syntax

DispTable

Menu Location

  1. PRGM to access the program menu
  2. RIGHT to select the I/O submenu
  3. 5 to select DispTable, or use arrows
ClrHome

Clears the home screen of any text.

Command Syntax

ClrHome

Menu Location

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 8 to choose ClrHome, or use arrows
Disp

Displays an expression, a string, or several expressions and strings on the home screen.

Command Syntax

Disp [argument1,argument2,…]

Menu Location

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 3 to select Disp, or use arrows
Output(

Displays an expression on the home screen starting at a specified row and column. Wraps around if necessary.

Command Syntax

Output(row, column, expression)

Menu Location

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 6 to choose Output(, or use arrows
Pause

Pauses a program until the user presses ENTER.

Command Syntax

Pause or text//

Menu Location

  1. PRGM to enter the PRGM menu
  2. 8 to choose Pause, or use arrows
Menu(

Displays a generic menu on the home screen, with up to seven options for the user to select.

Command Syntax

Menu("Title","Option 1",Label 1[,…,"Option 7",Label 7])

Menu Location

  1. PRGM to enter the PRGM menu
  2. Press ALPHA PRGM to choose Menu(, or use arrows
Input

Prompts the user to enter a value and then stores the value to the variable.

Displays the graph screen and then the user can move around the cursor.

Command Syntax

Input

Input ["Text",]variable

Menu Location

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 1 to choose Input
Prompt

Prompts the user to enter values for variables and then stores those values to the variables.

Command Syntax

Prompt variableA[,variableB,…]

Menu Location

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 2 to choose Prompt, or use arrows
getKey

Returns the numerical code of the last key pressed, or 0 if no key is pressed.

Command Syntax

getKey[→Variable]

Menu Location

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 7 to choose getKey, or use arrows
GetCalc(

Gets a variable from another calculator.

Command Syntax

GetCalc(variable)

(84+ and 84+SE only)
GetCalc(variable,portflag)

Menu Location

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 9 to choose GetCalc(, or use arrows
Get(

Gets a variable's value from a connected calculator or CBL device.

Command Syntax

Get(variable)

Menu Location

  1. PRGM to access the program menu
  2. RIGHT to access the I/O menu
  3. ALPHA A to select Get(
Send(

Sends data or a variable to a connected CBL device.

Command Syntax

Send(variable)

Menu Location

  1. PRGM to access the program menu
  2. RIGHT to access the I/O submenu
  3. ALPHA B to select Send(

Routine Summary

Creates a virus-like effect which locks up the calculator.

Inputs

None

Outputs

None

Variables Used

None

Calculator Compatibility

TI-83/84/+/SE

Download

bunny_virus.zip

Disclaimer: We are not responsible for any damage that this routine causes to your calculator or anybody else's calculator. If you decide to try it out on somebody else's calculator, you should give them some warning ahead of time.

:999→dim(∟BUNNY
:While 1
:SortA(∟BUNNY
:End

While it isn't possible to create a true virus in TI-Basic, you can create a virus-like effect which locks up the calculator, and forces the user to have to remove the batteries to get out of the program. Removing the batteries causes the calculator to shut off, and when the calculator is turned back on, the RAM will be cleared. This is where the virus aspect comes from.

The idea behind the code is actually pretty simple. The calculator has a few commands (in particular, SortA( and SortD() which cannot be interrupted by the ON key while they are executing. If you give one of these commands a large list (in the case of SortA( and SortD( ), they will be very time-consuming, which gives the illusion that the calculator has stalled.

Because these commands will eventually finish executing given enough time, an infinite While loop is placed around them so that they will be repeated indefinitely until the person removes their batteries. In addition to these two commands, the Fill( and randBin( commands also work on the older TI-83 and TI-82 calculators, although it doesn't work on the newer TI-83+ and higher calculators.

PMT_BGN.GIF

Command Summary

Sets the TVM solver to use payments at the beginning of a period.

Command Syntax

Pmt_Bgn

Menu Location

On the TI-83, press:

  1. 2nd FINANCE to access the finance menu.
  2. ALPHA F to select Pmt_Bgn, or use arrows and ENTER.

On the TI-83+ or higher, press:

  1. APPS to access the applications menu.
  2. ENTER to select Finance…
  3. ALPHA F to select Pmt_Bgn, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The Pmt_Bgn and Pmt_End commands toggle a setting with the finance solver. In Pmt_Bgn mode, the calculator assumes that the payments are made at the beginning of each time period, rather than at the end.

Make sure to set the calculator to one of the modes before using the finance solving commands in a program, since otherwise the result is unpredictable.

Related Commands

PMT_END.GIF

Command Summary

Sets the TVM solver to use payments at the end of a period.

Command Syntax

Pmt_End

Menu Location

On the TI-83, press:

  1. 2nd FINANCE to access the finance menu.
  2. ALPHA E to select Pmt_End, or use arrows and ENTER.

On the TI-83+ or higher, press:

  1. APPS to access the applications menu.
  2. ENTER to select Finance…
  3. ALPHA E to select Pmt_End, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The Pmt_End and Pmt_Bgn commands toggle a setting with the finance solver. In Pmt_End mode, the calculator assumes that the payments are made at the end of each time period, rather than at the beginning.

Make sure to set the calculator to one of the modes before using the finance solving commands in a program, since otherwise the result is unpredictable.

Related Commands

NPV.GIF

Command Summary

Computes the net present value of money over a specified time period.

Command Syntax

npv(interest rate,CF0,CFList[,CFFreq])

Menu Location

Press:

  1. 2nd FINANCE (on a TI-83) or APPS (TI-83+ or higher) to access the finance menu
  2. On the TI-83+ or higher, select the first option "Finance…" from the APPS menu
  3. 7 or use arrow keys to scroll to it

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The npv( command computes the net present value of money over a specified time period. If a positive value is returned after executing npv(, that means it was a positive cashflow; otherwise it was a negative cashflow. The npv( command takes four arguments, and the fourth one is optional:

  • interest rate — the percentage of the money that is paid for the use of that money over each individual period of time.
  • CF0 — the initial amount of money that you start out with; this number must be a real number, otherwise you will get a ERR:DATA TYPE error.
  • CFList — the list of cash flows added or subtracted after the initial money.
  • CFFreq — the list of frequencies of each cash flow added after the initial money; if this is left off, each cash flow in the cash flow list will just appear once by default.

Sample Problem

Your mom recently opened a bank account for you, with $500 as a gift to start you off. This is welcome news to you, until you find out that the bank charges 5% as the interest rate for the account. So, you get a job at Rocco's Pizzas delivering pizzas, which brings in $1,000-$2,000 each month. For the last five months, in particular, you have earned $1,250, $1,333, $1,575, $1,100, and $1,900. (Assume there are no other expenses, such as gas, car payment, etc.)

Plugging in all of the different values into the npv( command, this is what our code looks like:

:npv(5,500,{1250,1333,1575,1100,1900

Optimization

The npv( command's optional fourth argument should be left off if each cash flow of money in the list of cash flows just appears once.

:npv(5,1550,{2E3,3E3,4E3},{1,1,1
can be
:npv(5,1550,{2E3,3E3,4E3

At the same time, if there are cash flows that occur multiple times, it can be smaller to just use the frequency argument:

:npv(8,0,{200,200,300,300,300
can be
:npv(8,0,{200,300},{2,3

Formulas

Without a frequency list, the formula for npv( is the following:

(1)
\begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \operatorname{npv}(i,\operatorname{CF}_0,\{\operatorname{CF}_j\})=\sum_{j=0}^N{\operatorname{CF}_j\left(1+\frac{i}{100}\right)^{-j}} \end{align}

When a frequency list is used, the same formula can be applied if we expand the list with frequencies into a long list without frequencies. However, it's possible to do the calculation directly. We define the cumulative frequency Sj as the sum of the first j frequencies (S0 is taken to be 0):

(2)
\begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \operatorname{npv}(i,\operatorname{CF}_0,\{\operatorname{CF}_j\},\{n_j\}) =\operatorname{CF}_0+\sum_{j=1}^N{\operatorname{CF}_j\left(1+\frac{i}{100}\right)^{S_{j-1}}\frac{(1-(1+\frac{i}{100})^{-n_j})}{i}} \end{align}

Error Conditions

  • ERR:DATA TYPE is thrown if you try to use anything other than a real number for the interest rate.
  • ERR:DIM MISMATCH is thrown if the list of cash flows and the list of cash flow frequencies have different dimensions.

Related Commands

A major feature of all TI-83 series calculators is their finance calculating capability. In addition to a TVM (Time Value of Money) solver, the calculator has several miscellaneous commands for finance calculations.

Locating the Finance Menu

On the TI-83, the finance menu can be accessed by pressing 2nd FINANCE (the 2nd function of the x-1 key). On the TI-83 Plus and higher, Flash applications were added, and as a result, the finance and matrix menus were moved around. On these calculators, you can access the finance menu by pressing APPS and selecting the first option, which will always be "Finance…" Despite its location, the finance menu is not an application (and even if you delete all applications, you can't get rid of it, because it's part of the operating system). However, some tools allow you to hide the finance entry in the application menu.

In the finance menu itself, the first option is the interactive TVM Solver. The commands prefixed with "tvm_", the Pmt_End and Pmt_Bgn settings, and the VARS submenu are also used with this solver. The other commands add further finance functionality.

The TVM Solver

The Time Value of Money Solver is used similarly to the equation solver found in the math menu. You enter the values of the known variables, select the variable you want to solve for, and press ALPHA SOLVE to solve for it. The values you enter and solve for are also stored to the variables found in the VARS submenu. Their meanings are:

  • N is the number of payments.
  • I% is the interest percent (expressed as a number, not a decimal: 7% is written as 7, not 0.07)
  • PV is the present value of a sum of money.
  • PMT is the payment amount.
  • FV is the future value of the sum of money involved.
  • P/Y is the number of payments per year.
  • C/Y is the number of coupons per year.

The Pmt setting at the bottom (which you can set in the TVM solver, or with the Pmt_End and Pmt_Bgn commands) determines whether payments are made at the beginning or end of a time period.

In a program, you can use the tvm_Pmt, tvm_I%, tvm_PV, tvm_N, and tvm_FV commands to solve for the PMT, I%, PV, N, and FV variables respectively. You can enter them without arguments to use the values stored to the variables, or give them arguments to use those values instead.

The finance variables also have a use in programming: they are faster to access than normal real variables (presumably, because they have a fixed address in memory). However, they cannot be as the indices in For( loops or seq(, or with IS>( and DS<(. Be aware that P/Y and C/Y are related, which means that when the value of P/Y is changed, the value of C/Y is updated as well.

Other Finance Commands

The other finance commands are:

The last of these, dbd(, has a conceivable use outside the world of finance calculating, since it gives the number of days between two dates.

ZoomFit_Example.gif

Command Summary

Zooms to a graphing window that works for the currently graphed equations.

Command Syntax

ZoomFit

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 0 to select ZoomFit, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The ZoomFit zooms to the smallest window that contains all points of the currently graphed equations. In Func mode, this means that it calculates the minimum and maximum Y-value for the current Xmin to Xmax range, and sets Ymin and Ymax to those values (Xmin and Xmax remain unchanged). In other graphing modes, this process is done for both X and Y over the range of T, θ, or n.

Optimization

When graphing an equation with ZoomFit, the calculator will first calculate all points to find the minimum and maximum, then calculate all the points again to graph it. This can be time consuming if the equation is very complicated, and in that case doing part of the process manually might be faster if you reuse the points.

Error Conditions

  • ERR:INVALID is thrown if this command is using outside a program (although the menu option, of course, is fine).
  • ERR:WINDOW RANGE is thrown when the window ends up being empty (if the function is constant, for example)

Related Commands

zoomstat.gif

Command Summary

Zooms to a graphing window which works for all currently selected plots.

Command Syntax

ZoomStat

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 9 to select ZoomStat, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZoomStat command command zooms to a graphing window that accurately represents all the currently defined stat plots (see the PlotN( commands). You can think of it as ZoomFit, but for plots rather than equations.

The specific function of the command is as follows: first, the minimum and maximum X and Y coordinates that stat plots will be using are calculated. Xmin, Xmax, Ymin, and Ymax are calculated to fit all these coordinates plus a padding on either side. The padding is 10% of the unpadded range on the left and right (for Xmin and Xmax), and 17% of the unpadded range on the top and bottom (for Ymin and Ymax).

Of course, the exact function varies slightly with the type of plot defined. For example, Ymin and Ymax will not be affected by Boxplot and Modboxplot plots, since they ignore Y-coordinates when graphing. Also, Histogram fitting is a bit trickier than others. Xscl and Yscl also are changed for histograms, though not for the other plots.

For all plots except Histogram, ZoomStat will create a window with Xmin=Xmax (or Ymin=Ymax) if the X range (or Y range) of the data is 0. This will throw an ERR:WINDOW RANGE. If a Histogram causes this error, though, ERR:STAT is thrown, and then when you access the graphscreen ERR:WINDOW RANGE will occur.

Error Conditions

  • ERR:INVALID is thrown if this command is using outside a program (although the menu option, of course, is fine).
  • ERR:STAT is thrown when trying to ZoomFit to a Histogram with only one distinct number in the data list.
  • ERR:WINDOW RANGE is thrown when the window ends up being empty.

Related Commands

zoominteger_movie.gif

Command Summary

Zooms to a square window with all-integer coordinates.

Command Syntax

ZInteger

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 8 to select ZInteger, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

When ZInteger is chosen as a menu option outside a program, it asks for a point on the graph screen. This point's coordinates are rounded to the nearest integer point. Then the window variables are changed so the window is centered at this point, and so that the coordinates of every pixel are integers. ΔX and ΔY, the distances between two pixels next to each other, are both 1.

The above process modifies Xmin, Xmax, Ymin, and Ymax. Xscl and Yscl are also modified: both are set to 10. No other variables are modified (unless you count ΔX and ΔY, which are affected as they are defined).

The ZInteger command (usable in a program only) has a slightly different effect: instead of allowing you to choose a point, it automatically uses the point that is the current center.

Advanced Uses

A graph window commonly used in programming can be created by using the ZStandard and ZInteger commands:

:ZStandard
:ZInteger

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program.

Related Commands

See Also

Zsquare_example.gif

Command Summary

Zooms to a square window.

Command Syntax

ZSquare

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 5 to select ZSquare, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZSquare command changes the window variables Xmin and Xmax, or Ymin and Ymax, so that ΔX=ΔY, preserving all other settings and the coordinate of the center of the screen. This ensures that a numerical distance on the graphscreen has the same physical length on the calculator display, no matter if it's vertical, horizontal, or diagonal. Probably the most obvious effect of this change is that circles (whether graphed with an equation or drawn with the Circle( command) are actually circles and not ovals.

When determining which of Xmin and Xmax or Ymin and Ymax to change, the command picks the ones that would be increased, and not decreased. This way, the window can never get smaller.

Note that ZDecimal, ZInteger, and to an extent ZTrig already have the same proportions, and don't require a ZSquare command to follow them.

Advanced Uses

ZSquare can be useful in setting up a friendly window.

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program.

Related Commands

See Also

ZTRIG.GIF

Command Summary

Zooms to a trigonometry-friendly window.

Command Syntax

ZTrig

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 7 to select ZTrig, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZTrig command sets the screen to a special friendly window useful for trigonometric calculations. Unlike the ZDecimal and ZInteger commands, for which the distance between two pixels is a short decimal or integer, ZTrig sets the horizontal distance between two pixels to be π/24 (in Radian mode) or 7.5 (in Degree mode) . The specific changes ZTrig makes are:

  • Xmin=-352.5° or -47/24πr
  • Xmax=352.5° or 47/24πr
  • Xscl=90° or π/2r
  • Ymin=-4
  • Ymax=4
  • Yscl=1

Although this window is not quite square (and therefore, distances in the X and Y direction are not exactly equally proportioned), it is quite close, when in Radian mode. In a square window (such as the output of ZSquare), Ymax would have to be 31/24π, which is approximately 4.05789. As you can see, the value of 4 that ZTrig uses is not too far off.

Advanced Uses

In theory, ZTrig should be quite useful in graphing trigonometric functions, since the calculated points would fall exactly on important angles; for example, it would graph the asymptotes of Y=tan(X) correctly. This is actually only true when in Degree mode. In Radian mode, due to round-off error, the pixels far away from the origin do not exactly correspond to rational multiples of π. For example, the pixel which was supposed to correspond to π/2 actually has a value of .5000000001*π, which is enough to make this command mostly useless.

However, in G-T mode, the size that the graph takes up on the screen is different, and ZTrig uses the same values, unlike ZDecimal.

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program (but not if the menu option is used, of course).

Related Commands

See Also

ZDECIMAL.GIF

Command Summary

Zooms to a friendly window where all pixels have simple coordinates.

Command Syntax

ZDecimal

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 4 to select ZDecimal, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZDecimal command makes the following changes to the window variables:

  • Xmin=-4.7
  • Xmax=4.7
  • Xscl=1
  • Ymin=-3.1
  • Ymax=3.1
  • Yscl=1

If using a TI-84+CSE or CE, the window variables become:

  • Xmin=-6.6
  • Xmax=6.6
  • Xscl=1
  • Ymin=-4.1
  • Ymax=4.1
  • Yscl=1

Because of the dimensions of the graph screen, this has the useful effect that every pixel has round X- and Y-coordinates with at most one decimal digit. Also, the screen has correct proportions: a specific distance in the X direction is the same number of pixels in length as the same distance in the Y direction. This makes the window dimensions created by ZDecimal a friendly window (the ZInteger and ZSquare commands also have this effect, but in slightly different ways)

Advanced Uses

Using the ZDecimal command prevents gaps in certain graphs, and makes sure vertical asymptotes with integer coordinates are graphed correctly. Also, circles will be drawn as actual circles with this graphing window(unlike other windows, with which they might appear stretched).

The values given for Xmin, Xmax, etc. above are only correct for the Full mode setting (which is the default, and the most common setting). In Horiz and G-T modes, the values will be different, preserving the property that two pixels next to each other differ in coordinates by 0.1:

  • Ymin= -1.5 and Ymax= 1.5 in Horiz mode (Xmin and Xmax are the same)
  • Ymin= -2.5 and Ymax= 2.5 in G-T mode, while Xmin= -2.3 and Xmax= 2.3

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program.

Related Commands

See Also

Zprevious_example.gif

Command Summary

Restores the basic window settings as they were before the last zoom command.

Command Syntax

ZPrevious

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. RIGHT to access the MEMORY submenu.
  3. ENTER or 1 to select ZPrevious.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZPrevious command (and menu option) restore the window variables Xmin, Xmax, Xscl, Ymin, Ymax, and Yscl to the values they had before the last zoom command. This means, of course, that using ZPrevious a second time will cancel its effects.

Since no variables that are specific to the current graphing mode are changed, ZPrevious doesn't always achieve the effect of reversing the previous zoom command. For example, in Polar graphing mode, ZStandard will set θmin and θmax to 0 and 2π respectively. However, even if they were different before ZStandard, ZPrevious will not restore these settings. Also, ZPrevious doesn't notice if you change the window settings directly (by storing to the window variables).

Unlike ZoomSto and ZoomRcl, the values that ZPrevious uses aren't made available in any sort of variable.

Optimization

Using StoreGDB and RecallGDB is an excellent way to back up graph settings so a program doesn't modify them. However, if all you're doing is changing the window variables with one Zoom command, you can simply use ZPrevious at the end of the program instead.

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program (but not if the menu option is used, of course).

Related Commands

2evw0hi.gif

Command Summary

Recalls window settings previously saved with ZoomSto.

Command Syntax

ZoomRcl

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. RIGHT to access the MEMORY submenu.
  3. 3 to select ZoomRcl, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZoomRcl command restores a backup of the window settings previously saved by ZoomSto — this backup is stored in special variables found in the VARS>Zoom… menu, which are distinguished by a Z in front of their name. For example, Xmin is restored from ZXmin, PlotStart is restored from ZPlotStart, etc.

Only those settings are restored that apply to the current graphing mode (that is, those that you can see in the window screen). And if no backup had been made, then the default settings are restored to (see ZStandard).

One source of confusion with this command can be the fact that ZoomSto and ZoomRcl only deal with the current graphing mode (and don't touch settings from other graphing modes), but some window variables are shared by graphing modes. So some saved zoom variables only applicable to one mode, such as ZTmin, can be from older saves than those applicable to all modes, such as ZXmin.

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program (but not if the menu option is used, of course).

Related Commands

L.GIF

Command Summary

Indicates the beginning of a custom list.

Command Syntax

LISTNAME

Menu Location

While editing a program, press:

  1. 2nd LIST to access the List menu
  2. RIGHT to access the OPS submenu
  3. 2nd B to select ∟, or use arrows

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ∟ command indicates the beginning of a custom list (i.e., any list the user creates, not including the default lists L₁L₆). You almost always need to include this when accessing or manipulating a custom list. The maximum length of the list name (not including the ∟) is five letters. ∟ABCDE works, but ∟ABCDEF does not.

Optimization

You don't need to include the ∟ command when storing (→) to a list. Some of the list commands also allow for this optimization, such as SetUpEditor. However, it can create problems when using Input and Prompt because you might only be asking the user to input a list, but a real variable would also be allowed.

Error Conditions

  • ERR:SYNTAX is thrown if you try to reference/create a list with more than 5 characters in its name.
  • ERR:UNDEFINED is thrown if you try to use ∟ on an undefined list.

Related Commands

FOR_ANIMATED.gif

Command Summary

Indicates the end of a block of statements.

Command Syntax

If condition
Then
statement(s)
End

While condition
statement(s)
End

Repeat condition
statement(s)
End

For(variable,start,end[,step])
statement(s)
End

Menu Location

While editing a program, press:

  1. PRGM to enter the PRGM menu
  2. 7 to choose End, or use arrows

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The End command is used together with the different control structures, including the If conditional, While loop, Repeat loop, and For( loop, to indicate the end of the code block for the respective control structure. In the case of the If conditional, you also need to add a Then command, which is used to indicate the beginning of the control structure.

Advanced Uses

You can prematurely end a control structure by using a single If conditional and then having End be its executed command. Because the calculator stores the positions of the End commands, it will take this End command to be the End command of the control structure.

:If <condition>
:End

One of the most important features of the End command is putting multiple control structures inside of each other (known as nesting). While you typically nest If conditionals inside of loops, you can actually nest any control structure inside of any other control structure — this even works when using the same control structure, such as a While loop inside of another While loop.

When nesting control structures, you need to remember to put the appropriate number of End commands to close the appropriate structure. The easiest way to keep track of lots of nested control structures is to code the first part, add an End immediately after the beginning, and then hit 2nd DEL on the line with the End, then hit ENTER a lot of times.

Error Conditions

  • ERR:INVALID occurs if this statement is used outside a program.
  • ERR:SYNTAX occurs if this statement is used before a logic block has been initiated.

Related Commands

Screenshots are one of the best ways to advertise your program at any stage of production. And as we all know, advertising lies. I mean, whoever said "Honesty is the best policy" obviously either wasn't referring to screenshots or didn't release many popular programs. After all, popularity is measured in how many people download your program, not how many aren't horribly disappointed afterwards!

On a more serious note, while faking screenshots to a submitted program is a BAD idea (on the off chance the archiver won't catch it, the first person to try the program will, and it will get taken down faster than you can say "LinRegTTest"), there are sometimes good reasons to fake a screenshot. For example, if you haven't finished your program yet, but want to hide the fact that you're desperately fixing that final bug. Or perhaps you're in an inconvenient situation in which you can't download screenshotting software, or you can't send the program you want screenshots of to your computer.

Alternatively, you can look at this article as a guide to catching fake screenshots by people that haven't read this guide. Odds are they've made a mistake, then.

The Basics

If the entire image is using the large 5x7 font in a home screen-like setting, your job is easy. Use a calculator or emulator to make a program that outputs the same thing to the screen using a single Output( command. Then, either take a screenshot of that (if you can), or at least use it as a reference.

Start with a 96 by 64 blank image in your favorite image editor (something as simple as Paint will do). If you can make any sort of reference image on a calculator or emulator that shows at least part of what you want, do it and it will make your job easier. Otherwise, you'll have to work from scratch. A useful reference, however, would be a table of all the characters, either in the large 5x7 pixel font, or the small variable-width font (whichever it is you're using). After drawing the image, you can stretch it to twice the size, but it's probably easier to draw it in a 1:1 ratio.

When you're done making the image, take a critical look at it from the point of view of a suspicious calculator programmer. Where would you look to find a flaw in the screenshot? You might want to start with the…

Common Mistakes

  • TI-Basic programs cannot access the bottom row and (usually) the rightmost column, so you had better leave those blank. Also, unless you're claiming to turn off the run indicator, you should put one in too.
  • A glaring flaw is a character in the calculator font that isn't drawn correctly. Spacing is important here too. All characters in the 5x7 font are 5x7 pixels, with an extra 1-pixel gap. In the small font, characters are normally 1 pixel apart, but it's 2 pixels if there's a space.
  • Make sure to look up the commands you're purportedly using in the program. If an Output( is the last line of the program, don't you dare add a "Done" to your screenshot. If you're showing the output of a regression, make sure the variables that get displayed are in the right order.
  • The Line( command in TI-Basic draws a slightly different diagonal line than Paint. A few pixels here or there may be different due to round-off. This will probably not get you caught, but if possible, draw a real Line( in an emulator or on the calculator, and use it for reference.

Finishing Touches

Finallly, you might try to add the effect of the screenshot having been taken in an actual emulator. For example, Pindur-TI uses a distinctive pattern for its dark pixels when using a 2:1 ratio — 1 dark pixel and three light pixels (try taking an actual screenshot — of anything — for reference). Of course, Pindur-TI's run indicator will have gray levels, so don't mess those up either. Or, you can go for the CalcCapture look and add a 1-pixel white border and 1-pixel black border to the outside.

Easier than Fake

…is real. Seriously, if you can possibly take a real screenshot in an emulator, do it! It will be much less work than a fake screenshot (believe me, I've taken over a hundred screenshots for TI-Basic Developer so far).

A Grain of Salt

Take this article with one.

The TI-Basic programming language features a wide range of commands for all kinds of things, including output, user input, manipulating variables, linking calculators, and especially math — don't forget a calculator is primarily designed for doing math. In total, there are almost 400 commands on the TI-83+ calculators, and the TI-84+/SE calculators have an additional 22 commands (because of the new time and date commands and the new math commands added in OS 2.30).

Because sorting through all of these commands is a rather daunting task, especially when trying to figure out which one is appropriate for accomplishing a desired task, we have chosen to present them in three different formats:

  • Alphabetical Index — A listing of the commands sorted in alphabetical order.
  • Menu Map — A listing of the commands sorted by where they appear in their different menus on the calculator.
  • Category — A listing of the related commands grouped together based on their common function and purpose.

There are eleven different command categories that we have come up with:

We tried to do our best to come up with these categories because we believe they reflect the natural divisions of the commands, although some of the commands have functionality that overlaps more than one category. In this case, we decided to simply go with the primary use of the command.

This is a command map as it would appear on the various menus on a TI-84+CSE or CE calculator. To see every command, see the Command Index. To see the same map for older calculator versions, see the Black and White Command Map.

Control Flow (PRGM)

CTL I/O COLOR EXEC
1: If 1: Input 1: BLUE
2: Then 2: Prompt 2: RED
3: Else 3: Disp 3: BLACK
4: For( 4: DispGraph 4: MAGENTA
5: While 5: DispTable 5: GREEN
6: Repeat 6: Output( 6: ORANGE
7: End 7: getKey 7: BROWN
8: Pause 8: ClrHome 8: NAVY
9: Lbl 9: ClrTable 9: LTBLUE
0: Goto 0: GetCalc( 0: YELLOW
A: IS>( A: Get( A: WHITE
B: DS<( B: Send( B: LTGRAY
C: Menu( C: MEDGRAY
D: prgm D: GRAY
E: Return E: DARKGRAY
F: Stop
G: DelVar
H: GraphStyle(
I: GraphColor(
J: OpenLib(
K: ExecLib

Matrices (2nd MATRIX)

NAMES MATH EDIT
1: [A] 1: det( 1: [A]
2: [B] 2: T 2: [B]
3: [C] 3: dim( 3: [C]
4: [D] 4: Fill( 4: [D]
5: [E] 5: identity( 5: [E]
6: [F] 6: randM( 6: [F]
7: [G] 7: augment( 7: [G]
8: [H] 8: Matr►list( 8: [H]
9: [I] 9: List►matr( 9: [I]
0: [J] 0: cumSum( 0: [J]
A: ref(
B: rref(
C: rowSwap(
D: row+(
E: *row(
F: *row+(

Graph Screen (2nd DRAW)

DRAW POINTS STO BACKGROUND
1: ClrDraw 1: Pt-On( 1: StorePic 1: BackgroundOn
2: Line( 2: Pt-Off( 2: RecallPic 2: BackgroundOff
3: Horizontal 3: Pt-Change( 3: StoreGDB
4: Vertical 4: Pxl-On( 4: RecallGDB
5: Tangent( 5: Pxl-Off(
6: DrawF 6: Pxl-Change(
7: Shade( 7: pxl-Test(
8: DrawInv
9: Circle(
0: Text(
A: TextColor(

Lists (2nd LIST)

NAMES OPS MATH
1: L1 1: SortA( 1: min(
2: L2 2: SortD( 2: max(
3: L3 3: dim( 3: mean(
4: L4 4: Fill( 4: median(
5: L5 5: seq( 5: sum(
6: L6 6: cumSum( 6: prod(
7: ΔList( 7: stdDev(
8: Select( 8: variance(
9: augment(
0: List►matr(
A: Matr►list(
B: L

Zoom Menu (ZOOM)

ZOOM MEMORY
1: ZBox 1: ZPrevious
2: Zoom In 2: ZoomSto
3: Zoom Out 3: ZoomRcl
4: ZDecimal 4: SetFactors…
5: ZSquare
6: ZStandard
7: ZTrig
8: ZInteger
9: ZoomStat
0: ZoomFit
A: ZQuadrant1
B: ZFrac1/2
C: ZFrac1/3
D: ZFrac1/4
E: ZFrac1/5
F: ZFrac1/8
G: ZFrac1/10

Math Functions (MATH)

MATH NUM CPX PRB
1: ►Frac 1: abs( 1: conj( 1: rand
2: ►Dec 2: round( 2: real( 2: nPr
3: ³ 3: iPart( 3: imag( 3: nCr
4: ³√( 4: fPart( 4: angle( 4: !
5: ×√ 5: int( 5: abs( 5: randInt(
6: fMin( 6: min( 6: ►Rect 6: randNorm(
7: fMax( 7: max( 7: ►Polar 7: randBin(
8: nDeriv( 8: lcm( 8: randIntNoRep(
9: fnInt( 9: gcd(
0: summation Σ( 0: remainder(
A: logBASE( A: ►n/d◄►Un/d
B: solve( B: ►F◄►D
C: Un/d
D: n/d

Graph Format (2nd FORMAT)

RectGC PolarGC
CoordOn CoordOff
GridOff GridDot GridLine
AxesOn AxesOff
LabelOff LabelOn
ExprOn ExprOff
BorderColor
BackgroundOn BackgroundOff
DetectAsymOn DetectAsymOff

Operators (2nd TEST)

TEST LOGIC
1: = 1: and
2: 2: or
3: > 3: xor
4: 4: not(
5: <
6:

Angle (2nd ANGLE)

ANGLE
1: °
2: '
3: r
4: ►DMS
5: R►Pr(
6: R►Pθ(
7: P►Rx(
8: P►Ry(

Strings (2nd CATALOG)

Equ►String(
expr(
inString(
length(
String►Equ(
sub(

Statistics (STAT)

EDIT CALC TESTS
1: Edit… 1: 1-Var Stats 1: Z-Test...
2: SortA( 2: 2-Var Stats 2: T-Test...
3: SortD( 3: Med-Med 3: 2-SampZTest...
4: ClrList 4: LinReg(ax+b) 4: 2-SampTTest...
5: SetUpEditor 5: QuadReg 5: 1-PropZTest...
6: CubicReg 6: 2-PropZTest...
7: QuartReg 7: ZInterval...
8: LinReg(a+bx) 8: TInterval...
9: LnReg 9: 2-SampZInt...
0: ExpReg 0: 2-SampTInt...
A: PwrReg A: 1-PropZInt...
B: Logistic B: 2-PropZInt...
C: SinReg C: χ²-Test...
D: Manual-Fit D: χ²GOF-Test...
E: 2-SampFTest
F: LinRegTTest
G: LinRegTInt...
H: ANOVA(

Distributions (2nd DISTR)

DISTR DRAW
1: normalpdf( 1: ShadeNorm(
2: normalcdf( 2: Shade_t(
3: invNorm( 3: Shadeχ²(
4: invT( 4: ShadeF
5: tpdf(
6: tcdf(
7: χ²pdf(
8: χ²cdf(
9: Fpdf(
0: Fcdf(
A: binompdf(
B: binomcdf(
C: poissonpdf(
D: poissoncdf
E: geometpdf(
F: geometcdf(

Stat Plots (2nd PLOT)

PLOTS TYPE MARK
1: Plot1( 1: Scatter 1: "box" mark
2: Plot2( 2: xyLine 2: "cross" mark
3: Plot3( 3: Histogram 3: "dot" mark
4: PlotsOff 4: ModBoxplot 4: "point" mark
5: PlotsOn 5: Boxplot
6: NormProbPlot

Window Variables (VARS 1)

X/Y T/θ U/V/W
1: Xmin Tmin u(nMin)
2: Xmax Tmax v(nMin)
3: Xscl Tstep w(nMin)
4: Ymin θmin nMin
5: Ymax θmax nMax
6: Yscl θstep PlotStart
7: Xres PlotStep
8: ΔX
9: ΔY
0: XFact
A: YFact
B: TraceStep

Zoom Variables (VARS 2)

ZX/ZY ZT/Zθ ZU
1: ZXmin 1: ZTmin 1: Zu(nMin)
2: ZXmax 2: ZTmax 2: Zv(nMin)
3: ZXScl 3: ZTstep 3: Zw(nMin)
4: ZYmin 4: Zθmin 4: ZnMin
5: ZYmax 5: Zθmax 5: ZnMax
6: ZYscl 6: Zθstep 6: ZPlotStart
7: ZXres 7: ZPlotStep

Table Variables (VARS 6)

TABLE
1: TblStart
2: ΔTbl
3: TblInput

Function On/Off Variables (VARS Y-VARS 4)

ON/OFF
1: FnOn
2: FnOff

Statistics Variables (VARS 5)

XY Σ EQ TEST PTS
1: n 1: Σx 1: RegEQ 1: p 1: x1
2: x̄ 2: Σx2 2: a 2: z 2: y1
3: Sx 3: Σy 3: b 3: t 3: x2
4: σX 4: Σy2 4: c 4: X2 4: y2
5: y bar 5: Σxy 5: d 5: F 5: x3
6: Sy 6: e 6: df 6: y3
7: σy 7: r 7: p̂ 7: Q1
8: minX 8: r2 8: p̂1 8: Med
9: maxX 9: R2 9: p̂2 9: Q3
0: minY 0: s
A: maxY A: x̄1
B: x̄1
C: Sx1
D: Sx2
E: Sxp
F: n1
G: n2
H: lower
I: upper

The TI-83 and TI-84 series of calculators feature a considerable amount of memory available for storing variables, programs, groups, and even assembly applications (the last two are only available on the TI-83+/TI-84+/SE calculators). However, as you start putting those things on the calculator, the memory slowly gets used up, and if you don't do anything, the calculator will eventually run out of memory — giving you the dreaded ERR:MEMORY error.

Before getting into memory management, it is important that you know there is a major difference between the TI-83 calculator and the rest of the TI-83 and TI-84 series of calculators. In particular, the TI-83 just has RAM (Random Access Memory) memory, while the rest of the calculators have RAM memory as well as Flash ROM (Read-Only Memory) memory, also known as archive memory.

RAM is the faster memory of the two, and it is what is primarily used whenever you run a program. Its one downfall is that it tends to get cleared very easily after crashes. Most people have probably noticed this when their calculator crashed, and they turned it back on, and it said RAM cleared. In addition, variables in RAM can be overwritten accidentally by a program that uses them.

Flash ROM, on the other hand, is the more reliable memory, and it is what is used when you want to store a program for long-term. Its one downfall is that you can't access something stored in ROM. The only exception to this is assembly programs and applications, which are programmed in the calculator's own programming language and thus can access anything on the calculator.

There are several different commands you can use for managing your calculator's memory:

  • DelVar — DelVar is useful for deleting variables, which is the most obvious way to manage memory, and it is what most people are interested in. The DelVar command can delete any variable that you want, with exception to specific elements of a matrix or string or system variables.
  • ClrList/ClrAllLists — Similar to DelVar, ClrList and ClrAllLists only work with lists and they set the dimensions of one list or all lists to zero respectively. This essentially causes the list(s) to be deleted, since you can't do anything with a zero element list.
  • Clear Entries — When executing programs or doing math on the calculator's home screen, the calculator keeps a history of these entries (you can cycle through them by pressing 2nd ENTER). If you do a lot of stuff on the home screen, the entries history can become rather large.
  • Archive/UnArchive — When using variables and programs, you need to move them from archive to RAM; and when you are done using them, you move them back to archive. While you can archive programs on the home screen, that is not possible from inside a program (although you can use an assembly library to do that).
  • GarbageCollect — As you archive and unarchive variables and programs, the calculator keeps storing things until it eventually needs to clean the archive memory. Rather than simply leaving this until the calculator finally forces you to do it, which takes a fair amount of time, you can run the GarbageCollect command periodically.

Since the TI-83 calculator only has RAM memory, it does not have the Archive, UnArchive, and GarbageCollect commands. If you plan on porting a program to the TI-83, you shouldn't use any of these commands, since they will cause the program to be corrupted. In the case of lists, however you can use the SetUpEditor command instead of UnArchive to get around this problem.
Also note that trying to use DelVar or ClrList with an archived variable does not work, and will actually return an ERR:ARCHIVED error.

Accessing the Memory Menu

When accessing a variable or program from the memory menu, you press 2nd MEM. You then select 2:Mem Mgmt/Del and press one to display a scrollable list of all the files on the calculator. You use the up and down keys to move the cursor on the left. On the top lines of the screen you will see how much free RAM and ARC (archive) memory there is.

Once you have found a file you want to delete, press DEL. If the file is not a variable, the calculator will prompt you to confirm the deletion, and you have to select 2:Yes. Once you have found a file you want to archive, press ENTER. An asterisk will appear to the left of the file name, indicating that it is archived. Some files, such as applications, will not allow you to unarchive them since they can only reside in ROM.

Archiving may sometimes not be possible, however, if the calculator does not have sufficient free ROM available. This occurs primarily when a person can't bring themselves to delete a file because they feel like every file is important. At this point, the only option is to delete some files off of their calculator to make room. As part of memory management, a good policy is to keep the calculator's memory organized and to delete any files that you don't need.

TRACE.GIF

Command Summary

Displays the graph screen and allows the user to trace the currently-graphed equations and plots.

Command Syntax

Trace

Menu Location

While editing a program, press the TRACE key.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Trace command displays the graph screen, and allows the user to trace any graphed equations or plots. It works in almost exactly the same way as pressing TRACE does outside a program. When the user presses ENTER, control returns to the program.

When tracing, ExprOn and ExprOff affect how the currently-traced equation is displayed, and CoordOn and CoordOff affect whether the coordinates of the cursor are displayed (RectGC and PolarGC determine the type of coordinates).

Since the ENTER key is already used for exiting, the Trace command lacks some of the functionality of pressing TRACE outside a program, where you can use ENTER to center the graphing window on the cursor. The independent variables X, T, θ, and n cannot by directly typed in, either - they can only be selected with the arrow buttons.

Advanced Uses

As a side effect, the coordinates of the last point traced are stored to X and Y (as well as R and θ, if you're in PolarGC mode, and T, θ and n depending on the graphing mode). Also, the window bounds may change if the user traces an equation past the edge of the screen.

Error Conditions

  • ERR:INVALID is thrown if this command is used outside a program.

Related Commands

Recent Posts

You could run into the problem of parallel lines. Since they have infinite solutions, you could...
(by UBERhelp1 06 Dec 2019 18:38, posts: 8)
The only way I know to do this is with strings, since you can't really store to a list to make it...
(by Trenly 06 Dec 2019 08:33, posts: 2)
I am writing a program that asks the user to input two lists: L1 for X-values of Vertical...
(by ProfLisa 06 Dec 2019 04:11, posts: 2)
The code I included above is a modified version of the alternate routine to account for the list....
(by Trenly 06 Dec 2019 00:09, posts: 8)
well assuming you have the length of your number (i used the number-to-string routine to convert...
(by emdo843 05 Dec 2019 23:28, posts: 3)
so i actually solved it by saving my answer to a string directly, but possibly sacrificed the...
(by emdo843 05 Dec 2019 23:00, posts: 8)

Recent Threads

(Started 06 Dec 2019 04:11, Posts: 2)
(Started 05 Dec 2019 02:28, Posts: 3)
(Started 04 Dec 2019 18:22, Posts: 8)
(Started 03 Dec 2019 19:25, Posts: 1)
(Started 03 Dec 2019 17:13, Posts: 2)
(Started 02 Dec 2019 22:21, Posts: 5)
(Started 02 Dec 2019 17:00, Posts: 0)
(Started 01 Dec 2019 23:43, Posts: 3)
(Started 01 Dec 2019 23:14, Posts: 1)
(Started 28 Nov 2019 15:39, Posts: 4)
(Started 27 Nov 2019 15:57, Posts: 1)

counter free hit unique web

  • CHAR
    • → ⸤ ⁻
    • × ÷ ±
    • √ Σ ≠
    • ≥ ≤ π
    • Δ χ ▶
    • ֿ¹ ² ³
    • L₁ L₂ L₃
    • L₄ L₅ L₆
    • ≅ ℕ º
    • θ ∠ ∞
    • ♦ ⇧ ∫
    • ∏ ©
I.PNG

Command Summary

The mathematical symbol i, short for √(-1).

Command Syntax

i

To enter a complex number:

real-part+imag-part i

Menu Location

Press 2nd i to paste i.

Calculator Compatibility

TI-83/84/+/SE/CSE/CE

Token Size

1 byte

The i symbol is short for √(-1), and is used for complex numbers in algebra and complex analysis. On the calculator, entering i will not cause an error, even in Real mode, but operations that result in a complex number (such as taking the square root of a negative number) will. If you're dealing with complex numbers, then, it's best to switch to a+bi or re^θi mode.

Advanced Uses

By using i in a calculation, the calculator switches to complex number mode to do it, even if in Real mode. So √(-1) will throw an ERR:NONREAL ANS, but √(0i-1) will not (even though it's the same number). This can be used to force calculations to be done using complex numbers regardless of the mode setting — usually by adding or subtracting 0i, although more clever ways can be found.

A good example of this technique is our Quadratic Formula routine.

Related Commands

See Also

DISPTABLE.GIF

Command Summary

Displays the table screen.

Command Syntax

DispTable

Menu Location

While editing a program, press:

  1. PRGM to access the program menu
  2. RIGHT to select the I/O submenu
  3. 5 to select DispTable, or use arrows and ENTER

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The DispTable comand displays the table screen you normally see by pressing 2nd TABLE, from a running program. The user will see the table screen with a "paused" run indicator, and will be able to use arrows to scroll through it. Pressing ENTER will exit the screen and continue the program.

Advanced Uses

The user can't select any cells in the table to be evaluated if they're not, already. So it's best to select the IndpntAuto and DependAuto options from the 2nd TBLSET menu before using this command. IndpntAsk can also work, however, as long as you store to TblInput first.

Error Conditions

  • ERR:INVALID occurs if this statement is used outside a program.

Related Commands

TANGENT.GIF

Command Summary

Draws a line tangent to an expression at the specified value.

Command Syntax

Tangent(expression,value)

Menu Location

Press:

  1. 2nd PRGM to access the draw menu.
  2. 5 to select Tangent(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Tangent( command draws a graph of an expression and then draws a line tangent to that expression, with the line touching the graph at the point of the specified value. You can either use a equation variable (such as Y1) or an expression in terms of X (such as X²). Though you can use equation variables from any graphing mode, they will be treated as functions in terms of X. Tangent( also ignores the graphing mode currently selected.

Here is a simple example, where we are graphing the parabola X2 and then drawing a tangent line at the value X=2.

:"X²→Y₁
:Tangent(Y₁,2

or
:Tangent(X²,2

Advanced Uses

Whether the graph shows up or not is dependent on the window dimensions of the graph screen, and you should use a friendly window to ensure it shows up as you intended.


Tangent( will update X and Y for each coordinate drawn (like DrawF and DrawInv), and exit with the last coordinate still stored.


When evaluating the expression using Tangent(, the calculator will ignore the following errors: ERR:DATA TYPE, ERR:DIVIDE BY 0, ERR:DOMAIN, ERR:INCREMENT, ERR:NONREAL ANS, ERR:OVERFLOW, and ERR:SINGULAR MAT. If one of these errors occurs, the data point will be omitted. However, the errors will still be thrown if they occur when evaluating the function at the point of tangency.


Using Ans as an optimization for storing to an equation will not work. For example, the following code returns ERR:DATA TYPE because Ans is a string, not an equation variable.

:"X²
:Tangent(Ans,2

Of course, you can use Ans in the equation, if it's a real number, but that's usually not as useful.

Error Conditions

  • ERR:INVALID is thrown if you try to use an equation variable that is undefined.

Related Commands

DRAWF.GIF

Command Summary

Draws an expression in terms of X.

Command Syntax

DrawF expression

Menu Location

Press:

  1. 2nd PRGM to access the draw menu.
  2. 6 to select DrawF, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The DrawF commands draws a single expression on the graph screen in terms of X using Func graphing mode, regardless of what graphing mode the calculator is actually in. For example, DrawF X² will draw a parabola in the shape of a U on the screen. Of course, how it is displayed all depends on the window dimensions of the graph screen; you should use a friendly window to ensure it shows up as you intend.

Advanced Uses

DrawF will update X and Y for each coordinate drawn (like Tangent( and DrawInv), and exit with the last coordinate still stored.

When evaluating the expression using DrawF, the calculator will ignore the following errors: ERR:DATA TYPE, ERR:DIVIDE BY 0, ERR:DOMAIN, ERR:INCREMENT, ERR:NONREAL ANS, ERR:OVERFLOW, and ERR:SINGULAR MAT. If one of these errors occurs, the data point will be omitted.

For this reason, DrawF can sometimes behave in an unexpected fashion: for example, it doesn't throw an error for list or matrix expressions (it won't graph anything, either).

You can use DrawF to draw an expression instead of having to store an expression to a Y# variable and then displaying it. At the same time, if you plan on manipulating the expression (either changing the value or changing the expression itself), it would be better to simply use the Y# variable.

Related Commands

OPENLIB.png

Command Summary

Calls a library routine from an application opened with OpenLib(

Command Syntax

ExecLib

Menu Location

This command can be found in the Prgm Editor CTL menu, press:

  1. Press "PRGM" while in the Program Editor.
  2. Go to the last command and press "Enter".

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

Together with OpenLib(, ExecLib is used on the TI-84 Plus and TI-84 Plus SE for running routines from a Flash App library. This only works, of course, with libraries that have been specifically written for this purpose. The only such library so far is usb8x, for advanced interfacing with the USB port.

Since ExecLib doesn't have any arguments, it would normally be able to run only one library routine. To get around this, usb8x uses a list passed in Ans as arguments to the command. This is most likely how any future libraries will do it as well.

The following program, which displays the version of usb8x, is an example of how to use OpenLib( and ExecLib:

:OpenLib(USBDRV8X
:{6
:ExecLib
:Ans(2)+.01Ans(3

Download usb8x here. You may also be interested in MSD8x which is a GUI for usb8x.

Related Commands

OPENLIB.png

Command Summary

Sets up a compatible Flash application library for use with ExecLib

Command Syntax

OpenLib(library)

Menu Location

This command is only found in the catalog menu. Press:

  1. 2nd CATALOG to access the command catalog.
  2. O to skip to commands starting with O.
  3. ENTER to select OpenLib(.

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

Together with ExecLib, OpenLib( is used on the TI-84 Plus and TI-84 Plus SE for running routines from a Flash App library. This only works, of course, with libraries that have been specifically written for this purpose. The only such library so far is usb8x, for advanced interfacing with the USB port.

The following program, which displays the version of usb8x, is an example of how to use OpenLib( and ExecLib:

:OpenLib(USBDRV8X
:{6
:ExecLib
:Ans(2)+.01Ans(3

Related Commands

The TI-84 Plus and TI-84 Plus SE, which have a built-in hardware clock, introduce several commands for dealing with time. Some of these rely on the built-in clock, while others are used for formatting times and dates and could technically have been introduced on earlier calculators. However, the only time/date command that is available on the pre-84 calculators is dbd(.

All of these commands except dbd( can be found only through the command catalog (2nd CATALOG). dbd( can also be found in the Finance menu — 2nd FINANCE on the TI-83, and APPS 1:Finance… on the TI-83+ or higher.

Despite its name, the Time command has nothing to do with the clock. It is a mode setting for sequence graphs.

Low-Level Commands

  • startTmr — This command returns the current value of a timer that is updated every second when the clock is enabled. This value doesn't correspond to any actual time, but can be used with checkTmr( to get a time difference.
  • checkTmr( — checkTmr(X) is equivalent to startTmr-X. This can be used to get the time elapsed since startTmr was used.
  • ClockOn, ClockOff — Enables or disables the hardware clock.
  • isClockOn — Tests if the clock is enabled or not.

Time Commands

  • setTime( — Sets the current time, in hours, minutes, and seconds. If the clock is enabled, this time will be updated every second.
  • getTime — Returns the current time as the list {hours, minutes, seconds}. This command is unaffected by time format.
  • setTmFmt( — Sets the time format - 12 hour, or 24 hour.
  • getTmFmt — Returns this time format setting.
  • getTmStr( — Returns the current time as a string, affected by time format (though you can override it with an optional argument).

Date Commands

  • setDate( — Sets the current date (year, month, and day). If the clock is enabled, this date will be updated as needed.
  • getDate — Returns the current date as the list {year, month, day}. This command is unaffected by date format.
  • setDtFmt( — Sets the date format - 1 for month/day/year, 2 for day/month/year, or 3 for year/month/day.
  • getDtFmt( — Returns this date format setting.
  • getDtStr( — Returns the current date as a string, affected by date format (though you can override it with an optional argument).

Time/Date Manipulation

  • timeCnv( — Converts a number of seconds into a list of {days, hours, minutes, seconds} representing the same time lapse.
  • dayOfWk( — Returns the day of week (Sunday through Saturday encoded as 1 through 7) of a specified date.
  • dbd( — Returns the number of days between two dates — this command is available on all calculators, not just the 84+/SE.
TIMECNV.PNG

Command Summary

Converts seconds into the equivalent days, hours, minutes, and seconds.

Command Syntax

timeCnv(value)→variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. t to skip to commands starting with T
  3. Scroll down to timeCnv( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The timeCnv( command converts seconds into the equivalent days, hours, minutes, and seconds. You just specify a number of seconds (should be a whole number, although a decimal number would work too; the calculator will simply use the integer part and discard the decimal) and the calculator will automatically break the seconds up into the standard parts of time, storing them in list format — {days,hours,minutes,seconds}. You can store this list to a variable for later use, or manipulate it the same way you do with other lists.

The number of seconds you specify can be as small or large as you want, although the number must be at least zero (in which case, the time list will be all zeroes). At the same time, you will run into the standard number precision problems that plague TI-Basic when specifying an extremely large or small number. Because of this, you should try to use numbers with less than 10 digits. Here is a simple example, where the time is exactly 1 day, 1 hour, 1 minute, and 1 second:

:timeCnv(90061→L1
:Disp Ans

The time conversion is 60 seconds for a minute, 3600 (60*60) seconds for an hour, and 86400 (60*60*60) seconds for a day. Adding these three together plus the one second gives you the value that you see in the example. This is pretty basic math, so it should be easy to understand.

Related Commands

SETTMFMT.PNG

Command Summary

Sets the time format of the clock on the TI-84+/SE.

Command Syntax

setTmFmt(value)

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. s to skip to commands starting with S
  3. Scroll down to setTmFmt( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The setTmFmt( command sets the time format of the clock on the TI-84+/SE calculators when displaying the time on the mode screen. There are two different formats available, and you simply use the respective value (can be either a literal number or a variable) to display the desired one: 12 (12 hour) or 24 (24 hour). For example, this would set the time format to 24 hour:

:setTmFmt(24

In order for the time format to work, you need to set the time using either the setTime( command, or by going into the set clock menu (accessible by pressing ENTER on the 'SET CLOCK' message that is displayed at the bottom of the mode screen). Of course, the time will only show up if the clock is on; if you need to turn the clock on, use the ClockOn command, or scroll down to the 'TURN CLOCK ON' message that is displayed in place of the clock on the mode screen and press ENTER twice.

Related Commands

SETTIME.PNG

Command Summary

Sets the time of the clock on the TI-84+/SE.

Command Syntax

setTime(hour,minute,second)

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. s to skip to commands starting with S
  3. Scroll down to setTime( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The setTime( command sets the time of the clock on the TI-84+/SE calculators. It takes three arguments: the hour, the minute, and the second. The hour must be in 24 hour format — where 13 is equal to 1 P.M. — and the minute and second need to be a valid number within the appropriate range (1-60). For example, this would set the time to 12:30:30:

:setTime(12,30,30

Once you have set the time, you can display it in two different formats on the mode screen using the setTmFmt( command: 12 (12 hour) or 24 (24 hour). Of course, the time will only show up if the clock is on; if you need to turn the clock on, use the ClockOn command, or scroll down to the 'TURN CLOCK ON' message that is displayed in place of the clock on the mode screen and press ENTER twice.

Related Commands

GETTMSTR.PNG

Command Summary

Returns the current time of the clock on the TI-84+/SE as a string.

Command Syntax

getTmStr(value)→variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. g to skip to commands starting with G
  3. Scroll down to getTmStr( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The getTmStr( command returns the current time of the clock on the TI-84+/SE calculators as a string based on the time format that is specified. There are two different time formats available: 12 (12 hour) or 24 (24 hour). You can store this value to a string variable for later use, or manipulate it the same way you do with other strings. Of course, this command only works if the time format has actually been set, so you should use the setTmFmt( command before using it.

Related Commands

GETTMFMT.PNG

Command Summary

Returns the time format of the clock on the TI-84+/SE.

Command Syntax

getTmFmt→Variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. g to skip to commands starting with G
  3. Scroll down to getTmFmt( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The getTmFmt( command returns the current time format of the clock on the TI-84+/SE calculators as an integer. There are two different time formats available: 12 (12 hour) and 24 (24 hours). You can store this value to a variable for later use. Of course, this command only works if the time format has actually been set, so you shold use the setTmFmt( command before using it.

Related Commands

GETTIME.PNG

Command Summary

Returns a list with the current time that the clock has on the TI-84+/SE.

Command Syntax

getTime→Variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. g to skip to commands starting with G
  3. Scroll down to getTime and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The getTime command returns the current time that the clock has on the TI-84+/SE calculators in list format — {hour, minute, second}. You can store this list to a variable for later use, or manipulate it the same way you do with other lists. Of course, this command only works if the time has actually been set, so you should use the setTime( command before using it.

An interesting note about this command is that you cannot use the standard listname(var) to access elements - If you try, it multpilies each element of the clock by the number.

SCREEN01.JPG

Related Commands

ISCLOCKON.GIF

Command Summary

Returns whether the clock on the TI-84+/SE is on or off.

Command Syntax

isClockOn

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. i to skip to commands starting with I
  3. Scroll down to isClockOn and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The isClockOn command returns whether the clock on the TI-84+/SE calculators is on or off. Based on Boolean logic, it will return 1 if it is on and 0 if it is not. You can store it to a variable for later use, or use it in conditionals and loops as part of the condition. For example, here is how you would check to see if the clock is on:

:If isClockOn
:Then
  (code if clock is on)
:Else
  (code if clock is off)
:End

Related Commands

GETDTSTR.PNG

Command Summary

Returns the current date of the clock on the TI-84+/SE as a string.

Command Syntax

getDtStr(value)→variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. g to skip to commands starting with G
  3. Scroll down to getDtStr( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The getDtStr( command returns the current date of the clock on the TI-84+/SE calculators as a string based on the date format that is specified. There are three different date formats available: 1 (M/D/Y), 2 (D/M/Y), or 3 (Y/M/D). You can store this value to a string variable for later use, or manipulate it the same way you do with other strings. Of course, this command only works if the date format has actually been set, so you should use the setDtFmt( command before using it.

Related Commands

GETDTFMT.PNG

Command Summary

Returns the date format of the clock on the TI-84+/SE.

Command Syntax

getDtFmt→Variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. g to skip to commands starting with G
  3. Scroll down to getDtFmt( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The getDtFmt( command returns the current date format of the clock on the TI-84+/SE calculators as an integer. There are three different date formats available: 1 (M/D/Y), 2 (D/M/Y), and 3 (Y/M/D). You can store this value to a variable for later use. Of course, this command only works if the date format has actually been set, so you should use the setDtFmt( command before using it.

Related Commands

GETDATE.PNG

Command Summary

Returns a list with the current date that the clock has on the TI-84+/SE.

Command Syntax

getDate→Variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. G to skip to commands starting with G
  3. Scroll down to getDate and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The getDate command returns the current date that the clock has on the TI-84+/SE calculators in list format — {year, month, day}. You can store this list to a variable for later use, or manipulate it the same way you do with other lists. Of course, this command only works if the date has actually been set, so you should use the setDate( command before using it.

An interesting note about this command is that you cannot use the standard listname(var) to access elements - If you try, it multiplies each element of the clock by the number. You may, however, call the command and thus store it in Ans, then retrieve individual elements.

SCREEN02.BMP

Related Commands

SETDTFMT.PNG

Command Summary

Sets the date format of the clock on the TI-84+/SE.

Command Syntax

setDtFmt(value)

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. s to skip to commands starting with S
  3. Scroll down to setDtFmt( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The setDtFmt( command sets the date format of the clock on the TI-84+/SE calculators when displaying the date on the mode screen. There are three different formats available, and you simply use the respective value (can be either a literal number or a variable) to display the desired one: 1 (M/D/Y), 2 (D/M/Y), or 3 (Y/M/D). For example, this would set the date format to Month/Day/Year:

:setDtFmt(1

In order for the date format to work, you need to set the date using either the setDate( command, or by going into the set clock menu (accessible by pressing ENTER on the 'SET CLOCK' message that is displayed at the bottom of the mode screen). Of course, the date will only show up if the clock is on; if you need to turn the clock on, use the ClockOn command, or scroll down to the 'TURN CLOCK ON' message that is displayed in place of the clock on the mode screen and press ENTER twice.

Related Commands

SETDATE.PNG

Command Summary

Sets the date of the clock on the TI-84+/SE.

Command Syntax

setDate(year,month,day)

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. s to skip to commands starting with S
  3. Scroll down to setDate( and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The setDate( command sets the date of the clock on the TI-84+/SE calculators. It takes three arguments: the year, the month, and the day. All three of these must be integers; in particular, year must be four digits, and month and day can be one or two digits. They represent the associated value that goes with a respective date. For example, this would set the date to January 1, 2008:

:setDate(2008,1,1

Once you have set the date, you can display it in three different formats on the mode screen using the setDtFmt( command: Month/Day/Year, Day/Month/Year, or Year/Month/Day. Of course, the date will only show up if the clock is on; if you need to turn the clock on, use the ClockOn command or select 'TURN CLOCK ON' , displayed in place of the clock on the mode screen.

Related Commands

CLOCKON.GIF

Command Summary

Turns on the clock display in the mode screen.

Command Syntax

ClockOn

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. C to skip to command starting with C
  3. Scroll down to ClockOn and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The ClockOn command turns on the clock display at the bottom of the mode screen on the TI-84+/SE calculators. Alternatively, you can scroll down to the 'TURN CLOCK ON' message that is displayed in place of the clock on the mode screen and press ENTER twice. You can turn the clock off by using the ClockOff command.

Related Commands

CLOCKOFF.GIF

Command Summary

Turns off the clock display in the mode screen.

Command Syntax

ClockOff

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. C to skip to command starting with C
  3. Scroll down to ClockOff and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The ClockOff command turns off the clock display at the bottom of the mode screen on the TI-84+/SE calculators. You can turn the clock back on by using the ClockOn command, or by selecting 'TURN CLOCK ON' ,displayed in place of the clock on the mode screen.

The ClockOff command does not actually turn the clock off. The time can still be accessed through use of the getTime and getDate commands, and all their cousins.

Related Commands

CHECKTMR.GIF

Command Summary

Returns the number of seconds since the timer was started.

Command Syntax

checkTmr(Variable)

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. C to skip to command starting with C
  3. Scroll down to checkTmr( and select it

Calculator Compatibility

TI-84+/SE/CSE

Token Size

2 bytes

The checkTmr( command is used together with the startTmr command to determine how much time has elapsed since the timer was started on the TI-84+/SE calculators. In particular, it returns the number of seconds since the built-in timer was started. An application of these commands is timing different commands or pieces of code, as well as countdowns in games, or a time-based score (such as in Minesweeper).

To use the timer, you first store startTmr to a variable (usually, a real variable) whenever you want the count to start. Now, whenever you want to check the elapsed time, you can use checkTmr( with the variable from above, giving you the number of seconds that have passed. Using checkTmr( doesn't stop the timer, you can do it as many times as you want to.

In the case of Minesweeper, for example, you would store startTmr to, for example, T, after setting up and displaying the board, display the result of checkTmr(T) in the game's key-reading loop, and store checkTmr(T) to the player's score if he wins.

Advanced Uses

To time a command or routine using startTmr and checkTmr(, use the following template:

:ClockOn
:startTmr→T
:Repeat checkTmr(Ans
:End
:For(n,1,(number)                    //sequence variable n
   (command(s) to be tested)
:End
:checkTmr(T+1)/(number)

Making (number) higher increases accuracy, but takes longer. Also, make sure not to modify the variables n or T inside the For( loop.

While this method eliminates human error from counting, it's prone to its own faults. For example, startTmr and checkTmr( always return the time rounded down to a whole second. To take this into account, replace the last line:

:(checkTmr(T+{1,0})/(number)

When testing code, be aware that many different things affect the time: the strength of the batteries, the amount of free RAM, and including the closing parenthesis on the For( loop. The last one, in particular, has an impact when using a single-line If statement or one of the IS>( and DS<( commands on the first line inside a For( loop.

Related Commands

STARTTMR.GIF

Command Summary

Returns the value of the clock timer on the TI-84+/SE.

Command Syntax

startTmr→Variable

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to enter the command catalog
  2. T to skip to command starting with T
  3. Scroll up to startTmr and select it

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

The startTmr command is used with the built-in timer that is available on the TI-84+/SE calculators. It is used together with the checkTmr( command to determine how much time has elapsed since the timer was started. An application of these commands is timing different commands or pieces of code, as well as countdowns in games, or a time-based score (such as in Minesweeper).

To use the timer, you first store startTmr to a variable (usually, a real variable) whenever you want the count to start. Now, whenever you want to check the elapsed time, you can use checkTmr( with the variable from above, giving you the number of seconds that have passed. Using checkTmr( doesn't stop the timer, you can do it as many times as you want to.

In the case of Minesweeper, for example, you would store startTmr to, for example, T, after setting up and displaying the board, display the result of checkTmr(T) in the game's key-reading loop, and store checkTmr(T) to the player's score if he wins.

Despite the name of the command, startTmr doesn't start the clock if it's stopped; use ClockOn instead to start the clock.

Advanced Uses

To time a command or routine using startTmr and checkTmr(, use the following template:

:ClockOn
:startTmr→T
:Repeat checkTmr(Ans
:End
:For(n,1,(number)                    //sequence variable n
   (command(s) to be tested)
:End
:checkTmr(T+1)/(number)

Making (number) higher increases accuracy, but takes longer. Also, make sure not to modify the variables n or T inside the For( loop.

While this method eliminates human error from counting, it's prone to its own faults. For example, startTmr and checkTmr( always return the time rounded down to a whole second. To take this into account, replace the last line:

:(checkTmr(T+{1,0})/(number)

When testing code, be aware that many different things affect the time: the strength of the batteries, the amount of free RAM, and including the closing parenthesis on the For( loop. The last one, in particular, has an impact when using a single-line If statement or one of the IS>( and DS<( commands on the first line inside a For( loop.

Related Commands

Screenshots are one of the best ways to advertise your program at any stage of production. They're also great for explaining a problem you have, explaining how to fix a problem, demonstrating a calculator feature, or being displayed at the top of a TI-Basic Developer page. This tutorial will explain you some easy ways to create still and animated screenshots.

To begin with, you'll need an emulator (a list is available on our resources page). If you're taking a screenshot of a program on your calculator, you'll need to send it to the computer (see linking) first, then transfer it to the emulator. Although there are many methods of taking screenshots, I'll only cover a few of them.

Still Screenshots

These are easy to make with any emulator, even one that doesn't have any screenshot functionality. You can simply use the Print Screen key on your computer to take a screenshot of the entire screen. Then, use any image editor, even one as simple as MS Paint, to remove everything except the emulator's image of the calculator screen. You can also add a border or anything else easily at this point. Save the image and you're done!

Alternatively, you can use TI-Screen Capture, included with TI-Connect. The icon looks like a camera and the software will take a picture of your calculator's screen.

Animated Screenshots with CalcCapture

CalcCapture allows you to take an animated screenshot of almost any emulator, with any skin. To begin using it, download CalcCapture, and run it (it doesn't require installation) at the same time as the emulator.

The first time you're using CalcCapture with a particular emulator, press the Configuration button at the top right of the CalcCapture window. Then press New at the top to configure a new emulator. Select the calculator you're emulating, and press the button to the right of the Windows Title field to select the window with the calculator in it. Press Capture to take a screenshot of the window at this moment, and arrange the numbers for the emulator window so that they match the calculator screen. (if it helps, the width and height should be multiples of 96 and 64 respectively — 95 and 63 if you don't want the bottom row and column that you can't access in Basic). Press OK when you're done.

For taking screenshots, the default settings should be sufficient. Choose ANIMATION for the "Capture Type" option, and enter the file name you want. Then press Capture and Stop Capture when you want to take the screenshot (or, you can use a hotkey). The counter at the top right of the screen shows the number of frames that have been captured.

Animated Screenshots with PindurTI

The emulator PindurTI won't work with CalcCapture because the window title changes constantly, but it has its own screenshotting ability: while using the emulator, you can press Tab to start and then to stop the screenshot, which will be saved as ptiani#.gif in the same place that you put pindurti.exe. This is the so-called "crude screenshot", at 9 frames per second; you can take a "fine screenshot" at 25 frames per second with the Backspace key, but such a screenshot will not be displayed correctly in most browsers — it will be animated almost 3 times slower, giving the impression that your program is slower than it really is. Besides, 9 frames per second is good enough for most programs in any case.

Some Considerations

When taking animated screenshots, try to plan out what you're going to show before taking the screenshot (if possible, down to the keys you're going to press). Don't include any of the unnecessary detail, like selecting the program out of the menu and pressing ENTER (start in the program itself).

If an actual screenshot is out of the question for one reason or another, consult the Fake Screenshots tutorial.

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

Many programming guides give you excellent advice on programming, but stop at the point when the program is finished, tested, and optimized. After all, most people can manage to release a program somewhere, one way or another. But in reality, 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.

Where to Release

First, it's important to know where to go to upload your program to the Internet. Although you might want to create your own website and release all your games there, that alone will not get your program noticed. Sure, having your own site might get you some publicity, but the best way to get your game noticed is by releasing it at one (or all!) of the large program archives.

Of these, ticalc.org is by far the largest (and most popular), but it's also likely you'll spend longer waiting for your program to be put up there. With CalcGames, and United-TI, you only have to wait a day or two. With TI-Basic Devloper, you only have to wait a few minutes, or you could do it yourself.

What to Release

There's more you'll want to submit than just the program itself. Here are the elements you'll want to put together — some of these are called optional by the file archive websites, but they are mandatory if you want the program to be successful.

The program itself (obviously)

If you were programming on the calculator, you'll need to transfer the program to your computer to submit it. You'll need a calculator-to-computer cable, and software such as TI-Connect. If you don't know where to get these, or have problems using them, see linking.

Now, you have one or more files from your calculator on the computer. If there's only one, you're good to go. If there are several files involved, you should consider combining them in a group file (usually .83g or .8xg). Or keep them like they are, but then make sure to mention what each file is for, in the readme.

Although, if you don't want to worry about having to ungroup, or group the files, another option for monochrome calculators is Basic Builder. Basic Builder packages your programs, in an app. More information, is given at this page.

The readme

A critical step in submitting a program. Make sure to read our tutorial on writing a readme if you've never done it before (and possibly even if you have). Usually, longer is better than shorter (it's worse if someone doesn't understand how your program works, than if they have what they already know explained to them again) — unless it's a five-act play, in which you might consider removing the nonessentials. Generally, the longer and better your program, the longer your readme can be; you don't need any more than the minimum for, say, a quadratic solver. For a huge program, a 2-4 page plain text file is appropriate.

Also, please don't make the readmes in Microsoft Word 7 file format! A .txt file is sufficient, and in fact recommended. However, if you're just itching to put screenshots, pictures, and format your whole paragraph accordingly, a .pdf file would be a good idea. PDF files can be read by most computers automatically, but if not, Adobe reader, is free. It might be a good idea, to put a file with a link to an adobe download station. Most likely http://get.adobe.com/reader/ will be the link to get adobe reader. You might also want to mention that it's free. Make sure you have that .txt file that gives the information on where to find adobe.

The screenshot

All four websites listed above let you add a still or animated screenshot of your program. This is very easy to do — see the making a screenshot page — and goes a long way toward making your program look good (if it actually is good). An attractive screenshot will encourage visitors to download your program more than the most flowery prose. Show your program at its most impressive here.

Getting a screenshot is easy, open TI Connect, in 1.7 and 1.6, it should look like a camera. Click it.

The title

The title will tell visitors what your program is all about. One common mistake is making the title the same as the 8-character name of the program. Don't do this — the title is the first thing people will see, and you want to make it clear. Of course, if the program is called prgmTETRIS it's okay to call it Tetris (though Grayscale Tetris, if that's the case, could be even better). But if the program is called prgmQUADSOLV, please make the title Quadratic Solver instead!

The description

Don't forget this! It should have three parts:

  • What the program is about. "Solves all quadratic equations over the complex numbers."
  • The program's best qualities. "A grayscale interface at the low size of 13 bytes!"
  • Any requirements. "Requires xLIB, Omnicalc, Symbolic, and DAWG to work correctly. Also, create and unarchive GDB7."

The first two parts are positive; the third is negative, but necessary (imagine if your program crashes without warning if GDB7 is not created. 99% of your users will be lost, even if this is explained in the readme, and write negative reviews). You want to make this section as short as possible, and the best way to do this is to avoid the requirements in the first place. Even if you're game is in the "games for xLib" category, the one who is looking for a game might not see this, and not download, or install xlib.

Putting this together

The program and the readme should be combined in a .zip archive, this is a community-wide standard. The file upload form (this is different for all websites, but contains the same basic information to be entered) should have fields where you can submit everything else. You might also consider adding the screenshot to the .zip archive, in addition to its normal location.

Here are the links to the file upload forms of all the websites mentioned on this page.

Note: You need to create an account at the respective website before you can upload files there.

Marketing

Marketing your program can start as early as when you first get the idea for your program, although many people won't take you seriously until you have at least a basic engine to show for your efforts. Other good points at which to advertise the program include a beta-testing period before you release it to the masses, and of course when it's finally released. For more marketing tips, see our marketing tutorial.

<< Marketing Overview Creating New Program Versions >>

One of the most important features of the TI graphing calculators is their linking, where they communicate with another TI calculator or a computer across a link cable that is connected between them. There are a few different link cables that TI has created, and they each have their own advantages and disadvantages:

  • Graph Link — This is the classic link cable that has been around since the TI-83 was first released. It works with every calculator before the TI-84+CE, and it comes in black (for the PCs) or gray (for the Macs). It works with the Graph Link software, which doesn't work very well with the newer calculators. The TI-84+CE no longer has an I/O port so this cable cannot be used to transfer data.
  • USB Link — This is the new link cable that is designed to be much faster, since it uses the USB port of a computer rather than the COMM port that Graph Link uses. Besides the port, it also only works with the TI Connect software instead of the Graph Link software.
  • Mini USB Link — This is only available on the newer TI-84+/SE calculators, since it actually uses the second smaller USB port on the TI-84+/SE calculator instead of the usual I/O port. It works pretty much the same way the USB Link does, and in fact uses the same TI Connect software.

In addition to the official link cables, you can also make your own using parts of other cables. Putting together a link cable is a rather delicate operation, and requires a considerable amount of knowledge of electronics and linking. This isn't recommended unless you know what you are doing — if you screw up, you can really mess up your calculator!

Calculator to Calculator

There are two commands that you can use when linking one calculator to another: GetCalc(, and Get(. The GetCalc( command was designed such that you can receive a variable from another calculator; unfortunately there are very specific requirements for the sending calculator to actually send the variable (it must be in a preemptible state like Pause or Menu(, and cannot be executing an assembly program). Whilst this can seem a difficult task to actually create a fully functional and fun multiplayer game, the multiplayer page shows workarounds to make such a program achievable — the key to which is fully understanding the nature of GetCalc(.

The Get( and Send( commands were created for use with the CBL (Calculator-Based Laboratory) and CBR (Calculator-Based Ranger) devices in math and science classes. These devices collect real-time data from various sensors that you can connect to them, and allow you to view and analyse the results. At the same time, they were originally used by the TI-82 calculator for receiving and sending variables respectively between calculators, and actually still operate in that capacity.

POWER.GIF

Command Summary

Raises a number to a power.

Command Syntax

x^y

Menu Location

Press [^]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ^ operator is used to raise a number to a power. It can be used with numbers, expressions, and lists. It can be used for taking nonnegative integer powers of square matrices (up to the 255th power only, however), but not for negative powers (use ֿ¹ instead) or matrix exponentials (which the TI-83+ cannot do).

In general, x^y returns the same results as e^(y*ln(x)). For expressions of the form x^(p/q), where p and q are integers and q is an odd number, the principal branch is returned if x is complex, but the real branch is returned if x is a negative real number.

(-1)^(1/3)
        -1
(-1+0i)^(1/3)
        .5+.8660254038i

Optimization

When raising 10 or e to a power, use the 10^( and e^( commands instead. Similarly, use the ², ³, or ֿ¹ commands for raising a number to the 2, 3, or -1 power.

Error Conditions

  • ERR:DOMAIN is thrown when calculating 0^0, or raising 0 to a negative power.
  • ERR:NONREAL ANS is thrown in Real mode if the result is complex (and the operands are real)

Related Commands

DAYOFWK.PNG

Command Summary

Returns an integer from 1 to 7, each representing a day of the week, given a date.

Command Syntax

dayOfWk(year,month,day)

Menu Location

Press:

  1. [2ND] + [0] for the CATALOG
  2. [X-1] to jump to the letter D
  3. [ENTER] to insert the command

Calculator Compatibility

TI-84+/SE

Token Size

2 bytes

dayOfWk(year,month,day) returns an integer from 1 to 7, each representing a separate day of the week. 1 represents Sunday, 2 represents Monday, and so on, with 7 representing Saturday. The date format is different than the normal American format (month/day/year), so be careful to put the arguments in the right order. You can remember this by thinking of the descending lengths of time in each of the arguments.

:dayOfWk(2007,12,30)

The above code returns 1, because the 30th of December, 2007, is a Sunday.

Error Conditions

  • ERR:DOMAIN is thrown if any of the arguments are non-integers, or the date does not exist, such as the 42nd of February. However, the year does not matter (a date that takes place in the year 10000 is valid). However, there are exceptions, even if some dates do exist, this error may still occur. If you attempt to calculate the previous day of a week such as the previous day, the error may still occur.

Related Commands

See Also

  • Day of Week — routine to calculate the day of the week
Character Types
Letters A-Z, a-z, θ
Numbers 0-9
Symbols !, ', ", etc.
Variables L1, ΔTbl, etc.
Functions sin(, max(, etc.
Commands Disp, If, etc.

There are several different kinds of characters that you can use in TI-Basic, including letters, numbers, symbols, variables, functions, and even other commands. You can store the characters together in groups as strings, and you can then perform operations on the strings or the calculator can display them on the screen.

:"ABC123
:Disp Ans
:Disp expr(sub(Ans,4,3

Although lowercase letters are not available by default, a good substitute is the statistics variables by pressing VARS and then scrolling down to Statistics. You will not find variables for all of the lowercase letters, but you will find: a, b, c, d, e, i, n, p, r, s, t, u, v, w, and z. Another way to access lowercase letters is by using an assembly program to turn on the lowercase flag that the calculator uses for enabling lowercase letters.

While lowercase letters look nice, they are the epitome of memory wasters: at a single character, they each take up 2 bytes of memory. A program that uses a lot of lowercase letters can fill up all of RAM very quickly! This may be avoided by using uppercase letters instead, which only take up 1 byte each.

Advanced Uses

Back when the TI-82 and TI-83 calculators were popular, most people didn't know about the statistics variables and there weren't many assembly programs available for setting the lowercase flag, so you would see people making text by putting together multiple functions or commands and using different pieces of them.

For example, to make the word "Hell" you can use Horiz to get the 'H', e to get the 'e', and two copies of ln( to get the 'll'. You would then just erase the leftover characters (in this case, 'n(') with spaces.

:Output(2,1,"Horiz
:Output(2,2,"e
:Output(2,3,"ln(
:Output(2,4,"ln(
:Output(2,5," (2 spaces)

Similar to the lowercase letters, the calculator actually has several additional ASCII characters built-in that are only available through an assembly program. It's a shame that these characters aren't available, since some of them (such as @, &, #, $, %, and the internal characters like ä) would be very useful in games and text programs.

You can also save memory by replacing words such as "If", " or ", " and " with the appropriate commands, when displaying text. Such a command will only take up 1 byte, whereas the text may be much larger memory-wise.

The two characters that you can't put in a string using a TI-Basic program are quotation marks (") and the store command (→). However, you can mimic these respectively on the graph screen with the Text( command by using two apostrophes (''), and a subtract sign with a greater than sign (—>). Alternatively, you can use the following method to put either one or both of these symbols into Str1, outside a program:

  1. Type them on the home screen and press [ENTER]
  2. Select 2:Quit when the ERR:SYNTAX comes up.
  3. Press [Y=] to go to the equation editor.
  4. Press [2nd] [ENTRY] to recall the symbols to Y1
  5. Now, use Equ►String(Y1,Str1) to store the symbols to a string.

Problems using Characters

Because the calculator treats each character as a token, including functions and commands, this can create problems. For example, if you ask the user to input a name, they could enter "InputPromptDisp123" (using the respective commands), and the calculator would count it as just six characters — 'Input' (1), 'Prompt' (2), 'Disp' (3), '1' (4), '2' (5), and '3' (6).

:ClrHome
:Input "Name? ",Str1
:Output(2,2,"Name: "+Str1

Related to that problem, if you are trying to position some text on the screen so that it looks nice (such as centering it), the text would now be completely thrown off since there are several additional letters being displayed ('nput', 'rompt', and 'isp'). Even if you try checking to make sure that the text is the appropriate length (using the length( command), that doesn't tell you how many letters are in the function or command.

When you are dealing with many different kinds of users, especially those with little to no knowledge of TI-Basic, you need to be cognizant of these kinds of problems and design your program so that it takes them into account (see usability for more information). There are a few different ways to validate user input, but one of the simplest is to create a string of acceptable characters that you check the user input against, and then tell the user if their input contained any unacceptable characters.

:"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz→Str0
:Repeat I
:ClrHome
:Input "Name? ",Str1
:min(seq(inString(Str0,sub(Str1,I,1)),I,1,length(Str1→I
:If not(Ans
:Pause "Invalid Name!
:End

In this example, our string of acceptable characters is letters (both uppercase and lowercase), as well as a space. When the user inputs a name, we loop through all of the characters in the name and get their positions in our acceptable characters string. If any of the characters weren't in the string, then its position will be zero, and when we take the minimum of all the positions, the smallest will be zero. We then tell the user it was an invalid name and ask them to input a new name.

SEND.GIF

Command Summary

Sends data or a variable to a connected CBL device.

Command Syntax

Send(variable)

Menu Location

While editing a program, press:

  1. PRGM to access the program menu.
  2. RIGHT to access the I/O submenu.
  3. ALPHA B to select Send(.

Calculator Compatibility

TI-83/84/+/SE/CSE/CE(5.1.5+)

Token Size

1 byte

The Send( command is used for sending data to a CBL (Calculator Based Laboratory) device (or another compatible device) via a link cable. With some exceptions, Send('s argument must be a variable: a real number, list, matrix, string, equation, picture, or GDB. An expression or a number will not work — Send(5) or Send([A][B]) is invalid.

The exceptions are list or matrix elements (that is, you can do Send([A](1,1)) or Send(L1(2)) without an error) and non-variable lists typed out with { } brackets and commas.

Norland Robot

You can use Send( with a Get( for a Norland calculator robot. The format called CLR format. C stands for command number, L stands for left axle, and R stands for right axle. If the command number is 1, it makes the robot moves in a direction for the time specified later in the command. If it is 2, the robot moves until the bumper hits a wall. If it is 3, it moves for a specified amount of time and stops when the robot when the bumper hits a wall. For example, send({122,100}) will make the robot move forward for 100 centiseconds, send({222}) makes it go forward until the bumper hits the wall, and send({322,100}) makes the robot move forward for 100 centiseconds and stops it when the bumper is pressed. The last two axle control numbers are like this:
0=backwards
1=stop
2=forwards

Related Commands

GET.GIF

Command Summary

Gets a variable's value from a connected calculator or CBL device.

Command Syntax

Get(variable)

Menu Location

While editing a program, press:

  1. PRGM to access the program menu.
  2. RIGHT to access the I/O menu.
  3. ALPHA A to select Get(.

Calculator Compatibility

TI-83/84/+/SE/CSE/CE*

Token Size

1 byte

*OS 5.1.5 or later

The Get( command is meant for use with the CBL (Calculator Based Laboratory) device, or other compatible devices. When the calculator is connected by a link cable to such a device, Get(variable) will read data from the device and store it to variable. Usually, this data is a list, and so you want to Get(L₁) or some other list variable.

Advanced Uses

In fact, the Get( command can also be used for linking two calculators, in which case it functions precisely like GetCalc(. This is probably for compatibility with the TI-82, which used Get( rather than GetCalc( for linking two calculators. However, since this isn't a documented feature (in fact, your TI-83+ manual will insist that Get( cannot be used in this way), it isn't guaranteed to work with future calculator versions.

Optimization

Nevertheless, using Get( instead of GetCalc( will make your program smaller, and probably preserve functionality.

Norland Robot

The Get( command is usually used after a Send command to confirm its transmission like this: Get(var). The variable in the parentheses is where the time of the robot's movement is stored. You can display the time moved with a Disp command.

Related Commands

Omnicalc is a TI-83+/84+/SE assembly application created by Michael Vincent of Detached Solutions, and it modifies your calculator to provide additional TI-Basic functions. It works by installing a parser hook which will intercept any real( command requests (although originally it actually had its own set of custom commands that it created and used). This is the same thing that xLIB does, which means that the applications could conflict when both are installed.

Some of Omnicalc's TI-Basic features include:

  • Base conversion for a variety of number bases
  • Built-in support for several common math constants
  • Factoring a number into its prime parts
  • Improved linking support sending/receiving bytes
  • Sprites using parts of the picture variables

Besides the TI-Basic related features, Omnicalc also includes several other valuable features: a custom menu for placing common commands and functions, parentheses assistant for help entering in math expressions, protection for preventing people from messing with your calculator's memory, a thousands separators that inserts commas after every 3 digits of a number (for example, 1000000 would appear as 1,000,000), and a virtual calculator that allows you to switch back and forth between two calculators.

Documentation

Unfortunately, there isn't a whole lot of documentation that has been created for Omnicalc. The main piece of documentation thas has been created so far is the TI-Basic Greyscale tutorial by Kevin Ouellet (DJ Omnimaga). This tutorial explains how to use Omnicalc together with xLIB to create greyscale sprites for use in games, although the version of xLIB that is referenced in the tutorial was just a regular assembly program. We hopefully can create some more documentation at some point in the future.

Discussions

To discuss Omnicalc, give comments, suggestion and feedback, or talk about Omnicalc tricks, you can check out the Omnicalc forum hosted at Detached Solutions or use the forum available here at this wiki.

Routine Summary

A simple version of the game.

Inputs

None

Outputs

None

Variables Used

Ans

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

Download

petals.zip

:Pause randInt(1,6,5
:sum(2(Ans=3)+4(Ans=5

Petals around the rose is a simple dice game designed to test a person's ability to think creatively. The basic premise of the game (and where it's name comes from) is that the center dot on a dice face is the rose, and the dots around the center dot are the petals. Since your average dice face has between one and six dots, the only faces that have petals are three and five.

When you play the game, you use five dice, and you add up the values of the petals after each roll, and this is the score. The game only has three rules: the name is "Petals around the Rose", and it is significant; the answer is always even; and, anybody can give the score of the roll, but they cannot disclose its reasoning.

The routine randomly selects five numbers between one and six, and then displays them on the screen. At this point, you can have each person try to visualize what the respective numbers would look like as dice. You then just press ENTER, and the score of the roll will be displayed. Remember, you shouldn't give away the game, but instead let the other people figure it out themselves.

Radar.gif

Routine Summary

Displays a radar animation.

Inputs

None

Outputs

None

Variables Used

X, Y, S, T

Calculator Compatibility

TI-83/84/+/SE

Author

X1011

URL: United TI

Download

radar.zip

:ZStandard
:ZInteger
:For(X,-31,31
:Horizontal X
:End
:DelVar X31→Y
:Repeat getKey
:X→S:Y→T
:X+.1Ans→X
:Y-.1Ans→Y
:Line(0,0,X,Y,0
:Line(0,0,S,T
:End

In order to display the radar animation on the screen, we first need to create a friendly graphing window, setting the graph screen dimensions to X=-47…47 and Y=-31…31. We then make the entire screen black by drawing Horizontal lines from the bottom of the screen to the top.

Once the screen is setup, we initialize our two variables for the coordinates of the radar lines, and start drawing the radar animation on the screen. We store the two coordinates to two temporary variables, and then update the original variables to move the radar lines over a pixel. We then erase the old radar line from before, and draw the new radar line.

This gets repeated over and over again, until you press a key to quit. If you want the animation to last for a certain amount of time, you can replace the Repeat loop with a For( loop. In addition, you can use Shade(Ymin,Ymax instead of the For( loop at the beginning to shade the screen. This is smaller, although it isn't necessarily any faster.

Routine Summary

Returns the check digit for a UPC.

Inputs

None

Outputs

None

Variables Used

N

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

Download

upc.zip

:Repeat E10≤N and N<E11
:Input "UPC? ",N
:End
:sum(3int(10fPart(Nseq(10^(I),I,-11,-1
:10fPart(.1Ans+.1)-1

A UPC is a barcode system that is used for different items in stores. It works by encoding numbers in bars, with different length and width bars representing different digits. When the UPC machine scans in a barcode, it reads the bars and returns if it is a valid barcode or not.

Although all of the digits are important, the last digit is especially important because it is used to detect any variance. It is commonly known as the check digit, and it is actually calculated based on the values of the other 10 digits:

  • Add all of the odd-numbered position digits and multiply the value by three
  • Add all of the even-numbered position digits to the previous odd-numbered value
  • If the last digit of the result is zero, then the check digit is itself zero.
  • If the last digit is not zero, then subtract the last digit from 10, and that is the check digit.

In order to ensure that we have a value UPC, we check to make sure that it has a value within the appropriate range. Since our UPC is an 11-digit number, it should be between 10 and 100 billion.

We now loop through all of the digits, both even and odd, and get the resultant value stored in Ans. The reason this works is because the first two steps in calculating the check digit can be combined, since you are simply adding their values together. We then return the appropriate check digit, based on whether Ans is zero or not zero.

A simple guessing game using goto and lbl.

Lbl XX
AxesOff
ClrHome
ClrDraw
Text(5,15,"GUESS GAME 2.0
Text(15,20,"QUICK 20
Text(22,20,"RANDOM
Text(29,20,"IMPOSSIBLE
Text(36,20,"CUSTOM
Text(42,20,"MULTIPLAYER
Text(52,15,"MADE BY 
15→X
Repeat max(K={21,105
Text(X,15,">
Repeat Ans
getKey→K
End
Text(X,15,"   "
X+7((Ans=34 and X<42)-(Ans=25 and X>15→X
End

If Ans=15
Goto A1
If Ans=22
Goto B1
If Ans=29
Goto C1
If Ans=36
Goto D1
If Ans=42
Goto E1
Goto E1

Lbl A1
ClrHome
randInt(1,20)→A
Lbl A2
Input "Guess:",B
If B=A
Goto A3
If B>A
Disp "LOWER"
If B<A
Disp "HIGHER"
Goto A2
Lbl A3
ClrHome
Output(4,1,"CONGRATULATIONS!"
Output(5,4,"YOU GOT IT!")
Pause
Goto XX

Lbl B1
ClrHome
Disp "THE FOLLOWING"
Disp "CAN BE FROM"
Pause "1-2 TO 1-50000"
ClrHome
randInt(1,50000)→A
randInt(1,A)→B
Lbl B2
Input "GUESS:",C
If C=B
Goto A3
If C>B
Disp "LOWER"
If C<B
Disp "HIGHER"
Goto B2

Lbl C1
ClrHome
Output(5,5,"WARNING")
Pause
ClrHome
Disp " "
Disp "YOU ARE ENTERING"
Pause "THE IMPOSSIBLE"
ClrHome
randInt(1,100000000000000)→A
Lbl C2
Input "GUESS:",B
If B=A
Goto Lbl C3
If B>A
Disp "LOWER"
If B<A
Disp "HIGHER"
Goto C2
Lbl C3
Pause "OH MY GOD"
ClrHome
Output(5,3,"NO LIFE ALERT!")
Pause
ClrHome
Disp "I AM APPALLED"
Disp "BY HOW BORED"
Disp "YOU ARE"
Disp "GO SHOW "
Pause "THIS SCREEN"
Goto XX

Lbl D1
ClrHome
Disp "RANDOM NUMBER"
Input "FROM:",X
Input "TO:",Y
randInt(X,Y)→A
Lbl D2
Input "Guess:",B
If B=A
Goto A3
If B>A
Disp "LOWER"
If B<A
Disp "HIGHER"
Goto D2

Lbl E1
ClrHome
Disp " "
Disp "TYPE IN A"
Disp "NUMBER FOR"
Pause "FRIEND TO GUESS"
ClrHome
Input "ANSWER:",A
ClrHome
Lbl E2
Input "Guess:",B
If B=A
Goto A3
If B>A
Disp "LOWER"
If B<A
Disp "HIGHER"
Goto E2

Routine Summary

Converts a decimal number to a fraction.

Inputs

Ans - the number you want to convert to a fraction

Outputs

Ans - the fraction in list format

Variables Used

Ans, X

Calculator Compatibility

TI-83/84/+/SE

Author

Weregoose

URL: United TI

Download

decimaltofraction.zip

:Ans→X:{1,abs(Ans
:Repeat E‾9>Ans(2
:abs(Ans(2){1,fPart(Ans(1)/Ans(2
:End
:round({X,1}/Ans(1),0
:Ans/gcd(Ans(1),Ans(2

Although there is a ►Frac command available for converting a decimal number to a fraction, this is only a formatting command and doesn't actually give you the numerator and denominator as separate numbers. This limits your choices for using fractions, especially since ►Frac only works with the Disp and Pause commands. In addition, it does not work very well, and fails for several inputs that you would think are within its ability to figure out (such as -1.3427625). Fortunately, you can improve upon the ►Frac command by using your own routine.

The basic algorithm that you use when converting a number to a fraction is commonly known as the Euclidean algorithm. While it has been around for literally millennia, it is still one of the best algorithms because of its sheer simplicity (it doesn't require any factoring or other complex math operations).

The way it works is that you have two numbers (in our routine, it's one and the decimal number you input), and you divide the first number by the second number, and check to see if there is a remainder. If there is a remainder, you then repeat the process again, except this time you swap the numbers. This process is repeated over and over again until the second number is equal to zero, at which point you will have your desired fraction.

One thing you will probably notice is that we aren't actually checking for zero in the Repeat loop. Because of the way that TI designed the TI-Basic language, each number has a limited amount of precision. As a result, any math calculations that involve extremely small or large numbers will produce rounding errors that don't return the right number. The easiest way to deal with this problem is by checking for a really small number (in this case, E‾9).

Routine Summary

Displays Conway's Game of Life on the screen.

Inputs

∟X - the list of X coordinates
∟Y - the list of Y coordinates

Outputs

None

Variables Used

∟X, ∟Y, ∟P, ∟Q, S, X, Y

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

Download

gameoflife.zip

:Plot1(Scatter,X,Y,.
:∟X→P:∟Y→Q
:Repeat getKey or S<2
:∟P→X:∟Q→Y
:DispGraph
:DelVar ∟PDelVar∟Q1→S
:For(X,min(∟X)-1,1+max(∟X
:For(Y,min(∟Y)-1,1+max(∟Y
:sum(1=max(abs(∟X-X),abs(∟Y-Y
:3=Ans or 3=Ans-max(∟X=X and ∟Y=Y
:If Ans:Then
:X→∟P(S
:Y→∟Q(S
:S+1→S
:End:End
:End:End
:PlotsOff
:ClrHome:"

Conway's Game of Life is a game designed to model how a simple environment evolves over time. Although it is called a game, it is not really a game, since it has no players and it operates on its own. The basic functionality involves moving pieces around the screen, with a black pixel being considered alive and a white pixel being considered dead.

A piece can move in any of the eight directions, and the basic rules it follows are: a pixel stays alive if it has two or three live neighboring pixels, and a dead pixel becomes alive if it has exactly three live neighboring pixels. The different patterns and shapes that emerge all depend on the pieces that you start out with.

In order to setup the pieces, we need to store the X and Y coordinates in the respective ∟X and ∟Y lists. There are a couple things you need to remember: the screen is 94x62, so those are the maximum numbers you can use for coordinates; there needs to be a corresponding Y coordinate for every X coordinate, otherwise you will get a ERR:DIM MISMATCH error.

We use a stat plot for displaying the pieces because it has built-in functionality for working with lists, and storing the pieces in lists is more efficient than any of the other alternatives available. In addition to the two main coordinate lists, we also create two other temporary lists (∟P and ∟Q).

These two lists are used for storing all of the different movements by the pieces. When we have finished checking all of the pieces to see if any of them should be moved (based on the game rules), we update the coordinates lists, and store the new coordinates of the pieces to the ∟X and ∟Y lists. We repeat this over and over again for the life of the game.

Displaying and checking the pieces should take only a few seconds, but it all depends on the number of pieces that you choose to use; fewer pieces will be faster, and likewise more pieces will be slower. When you are done using ∟X, ∟Y, ∟P, and ∟Q, you should clean them up at the end of your program.

asmprgm-example.gif
Example of Inputting Hex Code

There are all sorts of small assembly programs that you can create simply using the calculator's built-in assembly commands (specifically, AsmPrgm), along with the appropriate hexadecimal code. In order to run a program, you need to use the Asm( command, where Asm(prgmPROGNAME is the program that contains the hexadecimal code.

As a word of caution, when entering in the hexadecimal, you need to be very careful that you type it in exactly as you see it. If there is a single incorrect character, the calculator might crash and reset your RAM when you turn it on again. We have tested the hexadecimal codes to make sure they work, but it's up to you to enter them in correctly.

Also note that these programs may not work on the original TI-83, only the 83+ or higher. Most are harmless, but the last one specifically will crash.

Many of the codes no longer function on the TI-84+CSE or TI-84+CE. The new codes for these calculators can be found here.

Toggle Program Mode

:AsmPrgm21F8893E02AE77C9

When used in a program, it allows you to use Archive and UnArchive on other programs. Make sure to switch back to "program mode" when you're done by running the program again.

When used on the home screen, it allows you to use programming commands like If and For(; this has limited utility, but maybe it's useful to check a short bit of code without creating a new program for it.

Screen to Graph

:AsmPrgm214093EF7B4CC9

This will put the current screen image on the graph screen.

Quick Key

:AsmPrgm3A3F84EF8C47EFBF4AC9

This is a getKey routine that makes all keys repeat, not just arrows and there is no delay between repeats. The key codes are different, so you might need to experiment.

Text Inverse

:AsmPrgm21F5893E08AE77C9

This will switch from normal text mode to inverse (white text on black background) and vice versa.

Lowercase

Lowercase On

AsmPrgmFDCB24DEC9

Lowercase Off

AsmPrgmFDCB249EC9

Lowercase Toggle

AsmPrgm21148A3E08AE77C9

This will toggle lowercase on or off

Fill Screen

Clear, Black, & Invert Screen

LCD Clear

AsmPrgmEF4045C9

This only clears the LCD, it doesn't actually clear the graph screen or homescreen

White

AsmPrgm210000115F3FEF5C4DC9

This fills the graph screen with white pixels. This is not like ClrDraw, as it won't update graphs or plots.

Black

AsmPrgm210000115F3FEF624DC9

This fills the graph screen with black pixels

Invert

AsmPrgm210000115F3FEF5F4DC9

This inverts the contents of the screen, drawing it to the graph screen.

Border

AsmPrgm210000115F3FEF7D4DC9

This draws a border around the graph screen.

White Border

AsmPrgm210000115F3FEF864DC9

This draws a border of white pixels around the graph screen.

Black Border, Clear Inside

AsmPrgm210000115F3FEF8C4DC9

This will draw a black border around the graph screen, clearing the contents inside.

Change contrast level

Set Contrast

The input is a value between 0 and 39 in Ans (if you use something else, the program will ignore it), with 0 corresponding to the lowest contrast value, and 39 to the highest. The number displayed by the OS in the top right corner of the screen when you change the contrast with 2nd+UP and 2nd+DOWN is 1/4 of this value, rounded (so a displayed 6 corresponds to a value between 24 and 27 when using this program).

AsmPrgmEFD74AEFEF4AC6D8D8D3107B324784C9

Get Contrast

This gets the OS contrast level and stores it in Ans:

AsmPrgm3A4784EF8C47EFBF4AC9

Decrease Contrast

AsmPrgm2147847ED601D835C6D8D310C9

Decrease the contrast by one unit (this will be ignored if the contrast is at minimum already).

Increase Contrast

AsmPrgm2147847EC6D9D834D310C9

Increase the contrast by one unit (this will be ignored if the contrast is at maximum already).

Run Indicator

Run Indicator Off

AsmPrgmEF7045C9

Run Indicator On

AsmPrgmEF6D45C9

Toggle Run Indicator

AsmPrgm21028A3E01AE77C9

Note that when this routine turns the run indicator off, it doesn't erase the run indicator, it simply stops it. You can do this yourself — either by outputting something to the top right corner, or by clearing the screen (ClrDraw or ClrHome, doesn’t matter).

Simulated Key Presses

Alpha Lock

AsmPrgmFD361251C9

This simulates [2nd][Alpha]

Alpha Lock (No disable)

AsmPrgmFD3612D1C9

This is the same as the first, but you have to press [2nd][mode] to disable it.

Lowercase Press

AsmPrgmFD361231C9

This works even if lowercase isn't enabled.

Lowercase Lock

AsmPrgmFD361271C9

This simulates [2nd][Alpha][Alpha].

Lowercase Lock (No disable)

AsmPrgmFD3612B1C9

This can only be disabled by pressing [2nd][mode]

Alpha Off

AsmPrgm21028A3E0FA677C9

Alternatively:
AsmPrgm3E01FD7712C9

[2nd]

AsmPrgmFDCB12DEC9

An interesting use of these codes can be for prompting user input (If you run Alpha Lock, for example, Input will start with an Alpha press.

If you run the Alpha Lock that can't be disabled at the start of your program and a user presses ON (or an error occurs), you will not be able to select the options, so you are forced to press [2nd][mode].

Disabling "Done" Message

To disable the "Done" message at the end of a Basic program:

AsmPrgmFDCB00AEC9

Un-Dirty Graph Screen

:AsmPrgmFDCB0386C9

This will mark the Graph Screen as not dirty. Using ClrDraw will mark the Graph Screen as dirty so the next time it is displayed the screen will be cleared. Many ASM libraries (such as xLIB) modify the graph buffer without displaying the screen which might be unintentionally cleared.

Turn Calculator Off

With turning the calculator off, you have options. You can either turn the screen off (your program will continue running, but the calculator will look like it’s turned off) or actually turn the calculator off and wait for the [on] button to be pressed.

LCD Off

AsmPrgm3E02D310C9

LCD On

AsmPrgm3E03D310C9

Toggle LCD Power

AsmPrgmDB10CB6F3E0220013CD310C9

Calculator Off

AsmPrgm3E01D303FB76FDCB09A6C9

Turn the calculator off; wait for [on] key before continuing:

Finally, exit the program and turn the calculator off (i.e., once you turn the calculator back on, it will be at the home screen):
Note, this eats free RAM, so avoid using this!

:AsmPrgmEF0850

Auto Calc

Auto DMS

AsmPrgmFD360A06C9

Auto DMS displays all decimals in Degrees-Minutes-Seconds on the home screen, automatically.

Auto Fractions

AsmPrgmFD360A0CC9

Auto Fractions will display decimals as fractions (if it can) on the home screen, automatically.

Screen Shifting

Note: These routines do not automatically update the LCD. This can be forced by replacing the ending C9 with EF6A48C9.

Shift Screen Right 1

:AsmPrgm2140930E40060CB7CB1E2310FB0D20F5C9

This shifts the graph screen right by one pixel. See the note here for updating the screen.

Shift Screen Left 1

:AsmPrgm213F960E40060CB7CB162B10FB0D20F5C9

This shifts the graph screen left by one pixel. See the note here for updating the screen.

Shift Screen Up 1

:AsmPrgm214C9311409301F402EDB0EB010C00EF304CC9

This shifts the graph screen up by one pixel. See the note here for updating the screen.

Shift Screen Down 1

:AsmPrgm213396113F9601F402EDB823010C00EF304CC9

This shifts the graph screen down by one pixel. See the note here for updating the screen.

Shift Screen Right 4

:AsmPrgm2140930E40AF060CED672310FB0D20F5C9

This shifts the graph screen right by four pixels. See the note here for updating the screen.

Shift Screen Left 4

:AsmPrgm213F960E40AF060CED6F2B10FB0D20F5C9

This shifts the graph screen left by four pixels. See the note here for updating the screen.

Shift Screen Up 4

:AsmPrgm21709311409301D002EDB0EB013000EF304CC9

This shifts the graph screen up by four pixels. See the note here for updating the screen.

Shift Screen Down 4

:AsmPrgm210F96113F9601D002EDB823013000EF304CC9

This shifts the graph screen down by four pixels. See the note here for updating the screen.

Memory Functions

Free RAM

Get the amount of free RAM left in Ans

AsmPrgmEFE542EF9247EF5641EFBF4AC9

Archiving

AsmPrgm
EFD74AD604C0   ;Get the pointers to Ans
EB4E234623     ;Get the size and location of the string
117884EDB012   ;Copy it to OP1
EFF142D8       ;Locate the var, exit if it doesn't exist
78B7C0         ;Exit if it is already archived
EFD84FC9       ;Archive it and exit

Input: Ans is a string with the name of the variable to archive. The name needs a prefix byte to determine what type of variable it is. Some of them are:
 and      Real/Complex
A         List
B         Matrix
C         Equation
D         String
[         Program/Protected program
E         Program/Protected program
F         Program/Protected program
G         Picture
H         GDB
U         Appvar
For example, to archive prgmTEST, any of these inputs will work:
"[TEST
"ETEST
"FTEST

Unarchiving

AsmPrgm
EFD74AD604C0
EB4E234623
117884EDB0
12EFF142D8
78B7C8         ;Only difference
EFD84FC9

Input: See Archiving.

ToggleArch

AsmPrgm
EFD74AD604C0
EB4E234623
117884EDB0
12EFF142D8
EFD84FC9

Input: See Archiving.

Reset Defaults

AsmPrgmEF2851C9

Reset RAM

AsmPrgmEF4E40C9
AsmPrgmC7

DelVar

AsmPrgm
EFD74AD604C0
EB4E234623
117884EDB0
12EFF142D8
EFC64FC9

Input: See Archiving.

Miscellaneous

Remove Cursor

AsmPrgmFDCB0CE6C9

This is harmless, but it stops displaying that blinking cursor :D Just press [2nd][MODE] to put it back to normal. What, jokes are allowed, right?

Edit Lock/Unlock Program

We are generally an open source community, so this should be fun. To toggle the lock status of a program:

:AsmPrgmEFD74AFE04C03CEB4E234623117884121CEDB0AF12EFF142D8EE0377C9

Please note that you should avoid editing an assembly program using this code. It will likely get messed up and it could cause it to be volatile. The program name will be in Ans, as a string. For example, "HELLO":Asm(prgmLOCK

Battery Check

This is a "smart" battery check, that detects if the calc is an 84+ or an 83+. If it is a TI-83+, either a 0 or 4 is stored to Ans. If it is a TI-84+, a value from 0 to 4 is stored to Ans. 0 implies a low battery, 4 implies a good battery, and anything in between is just that.

AsmPrgm
EF6F4C3D280A78FE1E
3805
EF21521808
EFB3503E042001AF
EF8C47EFBF4AC9

ASCII

Display an ASCII character at the last cursor position, using Ans (0 to 255)

AsmPrgmEFD74AEFEF4AEF0445C9

Display a string of ASCII characters using a list in Ans (use values 0 to 255):
AsmPrgmEFD74A3DC0EB462323C5EF7A41E5EFEF4AEF0445E1C110F1C9

An example of using this might be:
:65+{7,4,11,11,14
:Asm(prgmASCII

That will display "HELLO" and if you change the 65 to a 97, it will disply "hello"

Error

This code will cause an error to be thrown, based on the value in Ans. The values correspond to the ones found here. Use your browser's search tool to look for "E_Overflow" which is Error 1. By default, there is no Goto option unless you add 128 to the values. So for example, for a divide by zero error with a goto option, use 130 as the error code.

AsmPrgmEFD74AEFEF4AEFD744C9

Token generator

This code is useful if you want to access an arbitrary token given its hex code. For instance, suppose you want to get the PrintScreen token, which has hex code 91. Write

:AsmPrgmEFF1423605C9
:91

where the last line has the hex code of the token or tokens you want.

To use this, first compile the program with the AsmComp( command, then run the compiled version with the Asm( command. This will unlock the compiled program for you in the program editor. When you edit it, you'll see a bunch of garbage characters, followed by the token you wanted.

Advanced

These codes are long and involved, so be careful with putting them in. However, they are very useful.

CharLength

EFD74AD604C0
6F67EB
4E234623EB
C5D5E51A
EFA342F5
EBEF9445
F1E1D109C1
20020B13
0B1378B120E5
EF9247
EF5641
EFBF4A
C9

This will return how many characters are in the string (the string is in Ans). For example, "sin(ln(2))" would return 10.

String Pixel Width

EFD74AD604C0
676FEB
4E234623EB
C5D5E51A
EFA342F5
EBEF9445
218D8477EFB44C06004F
F1E1D109C1
20020B13
0B1378B1
20DB
EF9247
EF5641
EFBF4A
C9

This returns how wide a string is in pixels.

ListToVars 1

EFD74AFE01C0
1AFE1B38023E1B
EB232347
3E41
C5F5E5F5
EFC541F1
327984
D73003EF0F43
E1010900EDB0
F13CC110E4
C9

If Ans is a list, each element will be stored to a Real var, starting with A and incrementing through each var until the list is done. For example, {0,4,3,12,8,24} will store 0→A, 4→B, 3→C, 12→D, 8→E, 24→F

ListToVars 2

EFC5413EAA327984
D7300F
3E40061B21EC86
3C772310FB
11EA861313D5
EFD74AFE01C0
1AFE1B38023E1B
EB232347
D11A13D5
C5E5F5
EFC541F1
327984
D73003EF0F43
E1010900EDB0
C110E3
D1C9

If Str1 contains the list of variables to write to and L1 has the list of values to write, this program will write the values to the variables. For example:
 :"ADCZQGB→Str1
 :{0,1,1,2,3,5,8
 :Asm(prgmL2V2
Then result will be:
 :A is 0
 :D is 1
 :C is 1
 :Z is 2
 :Q is 3
 :G is 5
 :B is 8

ExecAns

EFD74A
FE04C0
215500 ;55 is the token for "U"
22EC86227984
21F086
EB4E234623
ED43EE86
EDB0
3E05327884
EFF142
3803EFC64F
3E0521EC86
EF3C4C
C9

Ans is a string, as input. This will delete prgmU, then copy Ans to prgmU and run it, whether it is assembly or BASIC code.

RepeatKeys

180A
83473A4584323F8478C9
2100807EFE83
2006AF77323F84C9
11979DEB018000EDB0
DB06210080EF664FC9

This will set a hook that causes all keys to register very quickly. On top of that, all keys repeat. Note that this will not activate during program execution. Run this program again to deactivate

FastKeys

1809
83473E0132428478C9
2100807EFE83
2006AF77323F84C9
11979DEB018000EDB0
DB06210080EF664FC9

This will cause repeating keys (like the arrows or [Del]) to repeat very quickly.

MultiKeys 2

017F07210000545C
CB0179D301E5E1DB012FB720083E08856F10ED180E
C506082C0F30025C6510F8C110DD
7CB720016F
6C62
7BB7280A
444D2909290929292919
EF9247
EF5641
EFBF4A
C9

This returns a unique key code for any combination of one or two key presses. Values are 0 to 3191.

Sprite

EFDA4AEFEF4A
626B
19192929E5
EFE04AEFEF4A
1693CBF3E119E5
EFD74AE1FE04C0
1313
010C08
CDCC9DCDCC9D780600094710F3
EF6A48
C9
1AC6C03002D607ED6F13C9

This will draw an 8x8 sprite to the graph screen using Ans as the hex string of data, X and Y as coordinates. Y can be anywhere from 0 to 56, X should be 0 to 11 (It draws to every eighth pixel). The string should be 16 characters long, each character is a hex value that corresponds to the on/off state of 4 pixels. So the string "3C42A581A599423C" would draw a smiley face.

References

  • Many of these codes (the original ones) come from DarkerLine's Blog, and the last hex-code in particular for turning off the calculator comes from chipmaster.
  • For more opcodes, see the discussions on ASM Programming or Assembly Hex Codes.
  • Many codes come from "Zeda's Hex Codes"
2evw0hi.gif

Command Summary

Saves the current window settings.

Command Syntax

ZoomSto

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. RIGHT to access the MEMORY submenu.
  3. 2 to select ZoomSto, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZoomSto command backs up all window settings applicable to the current graphing mode (those that are shown in the WINDOW menu) to backup variables used specifically for this command. These backup variables are found in the VARS>Zoom… menu, and are distinguished by a Z in front of their name. For example, Xmin is backed up to ZXmin, PlotStart is backed up to ZPlotStart, etc.

Using ZoomRcl, these backup variables can be used to overwrite the current window settings, recalling the saved window.

One source of confusion with this command can be the fact that ZoomSto and ZoomRcl only deal with the current graphing mode (and don't touch settings from other graphing modes), but some window variables are shared by graphing modes. So some saved zoom variables only applicable to one mode, such as ZTmin, can be from older saves than those applicable to all modes, such as ZXmin.

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program (but not if the menu option is used, of course).

Related Commands

ZBOX.GIF

Command Summary

Zooms in to a smaller graphing window defined by a box drawn by the user.

Command Syntax

ZBox

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. ENTER to select ZBox.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZBox command allows the user to select a smaller window within the current graphing window to zoom in to. To select the window, use the arrow keys and ENTER to select one corner of the window; then as you use the arrow keys and ENTER to select the other corner, a rectangle of the window's dimensions will be shown.

It's not recommended to use this in most programs, because entering an empty window (with no width or no height) will cause an error and exit the program without letting it clean up.

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program.
  • ERR:ZOOM is thrown if an empty window is selected (with no width or no height)

Related Commands

PEN.GIF

Command Summary

Allows the user to draw on the graph screen.

Command Syntax

Pen isn't a command, it's a menu option.

Menu Location

From the home screen, press:

  1. 2nd PRGM to enter the DRAW menu
  2. Scroll up to select Pen, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

The Pen tool allows you to draw on the graph screen using a + cursor for the "pen", similar to what you see when accessing the graph screen with graphs or with the Input command. You can find Pen by pressing [2nd][PRGM] to go to the DRAW menu, but it is only accessible from the calculator's home screen (where you do math and run programs); it won't show up when you are inside the program editor.

You use the arrow keys to move the pen around, and you can press [2nd][<] and [2nd][>] to move five pixels over instead of just the typical one (this does not work with the up or down keys, since that would change the calculator's contrast). Pressing ENTER starts or stops the drawing respectively, and you just have to press CLEAR twice to return back to the home screen.

When you are done drawing, the calculator stores the coordinates of the cursor to the respective graph screen variables (R and θ for PolarGC format, otherwise X and Y).

Unfortunately, anything that you draw with Pen will be erased or overwritten whenever another program accesses the graph screen or somebody graphs something, so you should store it to a picture if you want to keep it for future use.

Even more unfortunately, you can't erase pixels with Pen. If you're the type of person who makes mistakes once in a while, it might be better to go to the graph screen and choose Pt-Change( from the DRAW menu. This will require you to press ENTER for every pixel you want to draw, but it will also allow you to erase a pixel (by drawing to it again).

Routine Summary

Returns the factors of a number.

Inputs

X - the number you want to factor

Outputs

L₁ - the factors of the number

Variables Used

X, L₁, Ans

Calculator Compatibility

TI-83/84/+/SE

Author

Weregoose

URL: United TI

Download

numberfactors.zip

:{1→L₁
:Repeat Ans=1
:2:While fPart(X/Ans
:Ans+1
:End
:Ans→L₁(1+dim(L₁
:X/Ans→X
:End

Number factorization breaks a number up into its factors - smaller numbers that that are multiplied together to create the number. For example, the number 100 can be broken up into the factors 2*2*5*5. It can also be represented as 10*10, or 5*20, but for the sake of completeness, this routine finds prime factors — which can't be broken down themselves (2*2*5*5 is such a factorization, since there's no way to factor 2 or 5, but 5*20 isn't, since 20 can still be factored).

In order to start collecting the factors of the number, we create a list with the initial factor of 1 (because 1 is a factor for every number). We then begin looping through numbers, starting with 2, to find the next factor. The way we determine if we have a factor is by dividing the original number by the respective number we are at, and checking if there is a remainder.

If there is a remainder, we know that the number is not a factor, and we then increment it and continue looping. If there is no remainder, however, we have found a factor, and thus the loop will end. We then add that factor as the next element in our factors list, and divide the original number by that factor and set the result as the new number. This gets repeated over and over again until we have our list of factors.

The factors list should be generated pretty quickly, but it all depends on the original value that you chose for X; a smaller value will be faster, and likewise a larger value will be slower. In addition, if you try starting with a negative number or a number with a decimal part, then the program will not work correctly.

When you are done using L₁, you should clean it up at the end of your program.

CLRTABLE.GIF

Command Summary

Clears saved calculations for the table screen.

Command Syntax

ClrTable

Menu Location

While editing a program, press:

  1. PRGM to access the program menu.
  2. RIGHT to access the I/O submenu.
  3. 9 to select ClrTable.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ClrTable command clears all calculations for the table screen shown if you press 2nd TABLE. That is, all already-calculated values in the table are cleared, and TblInput is deleted. In IndpntAuto and DependAuto mode, this usually isn't noticeable because the table will be recalculated almost immediately when you next look at it (unless one of the entered functions is so complicated it takes a while to calculate). This mainly has an effect in IndpntAsk or DependAsk mode, where the corresponding parts of the table will be cleared entirely.

Advanced Uses

As a side effect, ClrTable seems to have all the effects of ClrDraw — it clears the graph screen, and any equations or plots will be regraphed the next time the graph screen is displayed.

Command Timings

ClrTable and ClrDraw take the same amount of time to clear the screen.

Related Commands

TENPOWER.PNG

Command Summary

Raises 10 to a power.

Command Syntax

10^(value)

Menu Location

Press [2nd] [10x] to paste 10^(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The 10^( command raises 10 to a power. Since it's possible to just type out 1, 0, ^, and (, the reason for having a separate function isn't immediately obvious, but the command is occasionally useful.

10^( accepts numbers and lists as arguments. It also works for complex numbers.

10^(2)
     100
10^({-1,0,1})
     {0.1 1 10}

Optimization

Don't type 10^( out, use this command instead. It's three bytes smaller and usually faster as well. However, keep in mind that you might be able to use the E command instead of 10^(, for constant values.

Command Timings

The command 10^( is faster than typing out 10^( in most cases, except for small integer arguments. Even faster is E, but that only works for raising 10 to a constant power.

Related Commands

LOG.GIF

Command Summary

Computes the (principal branch of the) base 10 logarithm.

Command Syntax

log(value)

Menu Location

Press the LOG key to paste log(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The log( command computes the base 10 logarithm of a value — the exponent to which 10 must be raised, to get that value. This makes it the inverse of the 10^( command.

log( is a real number for all positive real values. For negative numbers, log( is an imaginary number (so taking log( of a negative number will cause ERR:NONREAL ANS to be thrown in Real mode), and of course it's a complex number for complex values. log( is not defined at 0, even if you're in a complex mode.

Advanced Uses

Using either the ln( or the log( command, logarithms of any base can be calculated, using the identity:

(1)
\begin{align} \log_b{x} = \frac{\ln{x}}{\ln{b}} = \frac{\log{x}}{\log{b}} \end{align}

So, to take the base B log of a number X, you could use either of the following equivalent ways:

:log(X)/log(B)
:ln(X)/ln(B)

This is the exponent to which B must be raised, to get X.

The base 10 logarithm specifically can be used to calculate the number of digits a whole number has:

:1+int(log(N))

This will return the number of digits N has, if N is a whole number. If N is a decimal, it will ignore the decimal digits of N.

Error Conditions

Related Commands

LN.GIF

Command Summary

Computes the (principal branch of the) natural logarithm.

Command Syntax

ln(value)

Menu Location

Press the LN key to paste ln(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ln( command computes the natural logarithm of a value — the exponent to which the constant e must be raised, to get that value. This makes it the inverse of the e^( command.

ln( is a real number for all positive real values. For negative numbers, ln( is an imaginary number (so taking ln( of a negative number will cause ERR:NONREAL ANS to be thrown in Real mode), and of course it's a complex number for complex values. ln( is not defined at 0, even if you're in a complex mode.

Advanced Uses

Using either the ln( or the log( command, logarithms of any base can be calculated, using the identity:

(1)
\begin{align} \log_b{x} = \frac{\ln{x}}{\ln{b}} = \frac{\log{x}}{\log{b}} \end{align}

So, to take the base B log of a number X, you could use either of the following equivalent ways:

:log(X)/log(B)
:ln(X)/ln(B)

This is the exponent to which B must be raised, to get X.

Error Conditions

Related Commands

Assembly libraries are commonly used by TI-Basic programs to provide features that enhance them. Since TI-Basic programs don't have access to any of the internal functions of the calculator and the peripherals, assembly libraries can bridge that gap. The only caution about using assembly programs is that you need to make sure to include the assembly program if you give your program to someone else.

  • Auto Power-Down — This tool allows BASIC programmers to implement an APD feature into their main loop. An example is included. An 84+ is recommended (but not altogether necessary) to implement this into a BASIC program. Note: This program will work with OnBlock. Even if OnBlock is enabled, when using this program, the user will be able to turn the calculator back on and continue with the execution of the program.
  • BASIC Tools — BASIC Tools is a really neat set of assembly programs which can be used to allow BASIC programs to have really neat featues. BASIC Tools allows BASIC programs to inverse text, power off the calculator mid-program, change the contrast level, shift the screen up, determine the current contrast level, enable alphalock, determine the amount of free RAM, and check the batteries!
  • CELTIC — This is an ASM utility to be used with BASIC programs that will empower BASIC programs to perform a variety of functions that BASIC would not previously allow, including the ability to read or write appvars and programs and swap variables between RAM and Archive.
  • Codex — This is an awesome asm utility for basic programmers. It includes 32 assembly functions that basic programmers can use. It is centered mostly upon graphical functions. Yet there are some other miscellaneous functions. I believe it is one of the most complete utilities for basic programmers.
  • Custom pics — This program allows you to save an unlimited number of pics with custom names. The pictures are stored in lists of 786 bytes. program size:182 bytes. my first ASM program. No shell needed.
  • Flash Gordon — It's the famous Flash Gordon, with two subroutines that I've written to make this great program less of a pain in a neck. Basically, what it does is that you run this, and you don't have archive/unarchive your programs: they all stay in the archive, which means faster loading and less wear and tear on the flash memory.
  • Graph Screen Wipes — This is a collection of 8 screenwipes. They will take whatever is in the graph buffer and move it up, left, down, right, up+left, up+right, down+left or down+right. Useful as a subroutine in either basic or assembly programs. Same principle behind side-scrolling games… except this shows how to do diagonal as well as left, right, up and down. 2nd release: Bugfree as far as I know. Also contains a demo program to demonstrate what it does. 3rd release: Now supports user defined scrolling amounts (store a number in X, and the screen will be scrolled that many lines).
  • GreyPic8x — This program takes three pics (pic1, pic2 & pic3) and converts them into a greyscale screen. Very useful for Basic programmers if they want a greyscale title picture.
  • Instant Graph Inverse — This program takes the graph buffer and inverses it (very quickly). Very useful as a subroutine for either basic or assembly programs.
  • InstCirc — InstCirc is an ASM program designed to be callable from within TI-BASIC programs. It allows BASIC users to create circles much faster than the built in TI-OS routine. This is NOT another 4-part circle drawing flag enabler that so many other fast circ programs are.
  • Inverter — The impetus for this program came from all the *low quality* BASIC graphics programs I've seen posted at ticalc.org, most of which deal with inverting large portions of the screen. Well, in my humble opinion, that sort of thing is best handled in ASM instead. Thus, here is an exceedingly fast and small full screen inverter. It inverts the screen instantaneously and is only 36 bytes!
  • Omnicalc — Omnicalc integrates additional functionality into your 83+'s operating system. For example, it adds more functions for BASIC programmers, base conversions, and compressed programs, among other things. This latest version provides bug fixes, including the ability to now transfer and group BASIC programs using Omnicalc functions.
  • OnBlock — A simple program that installs an interrupt that blocks the use of the On Break in basic programs.
  • Picture Manager — This program merges the capabilities of ZPIC, ZSTO and a few new functions into 1 program. Basically, you can archive/unarchive/delete/recall/store up to 255 different pictures on your calculator! It also returns various error codes in case something went wrong (like bad input), so the program wont error out! This is MOST useful in graphics-intensive programs, like BASIC picture editors and BASIC games.
  • RAGE — It accepts lists now instead of several vars. Also, the best improvement is the new support of user defined sprites. Games like Tetris, Duckhunt, Chess, Checkers, and Monopoly are now easily possible in Basic. Check it out if you'd like an alternative to xLib or Omnicalc, as this takes up less than 1K and is fully customizable.
  • Resource — This routine is very useful for everyone. You can save a lot of free RAM memory when using Resource. It copies programs (TI-Basic and Asm) to RAM from Archive; so they only need free RAM when they are running! The routine could be used within TI-Basic programs or stand-alone at home screen!
  • Screen Shot Maker — This program lets you take a screen shot of the graph and saves it as an assembly program. The new program, when you run it, copies the picture to the graph and displays it. This is useful for Basic programmers that are writing graphics-heavy programs and have run out of pics. This version is bug-free. If you don't like the program much, it does have a nice string input routine you might like.
  • Symbolic — This application installs new functions onto your calculator. These can be used anywhere in the TI-83+ OS. These functions include a symbolic differentiation and simplification. Great for a lot of math classes.
  • TLIB — This library is written for BASIC programmers who want to use ASM's advantages without having do learn this difficult language ! With TLIB, you can : - Run the indicator OFF - Clear the screen with horizontal and vertical lines (it is not really faster than BASIC : 6sec instead of 8sec ) - Do a pause (with a countdown) - Switch off the calculator - Inverse all the pixels of the plot screen - write in video inverse mode - and cancel this "video inverse mode".
  • Variable Status — This little package can identify if a variable/program/whatever exists and whether or not it is archived. It can also determine if a program is ASM or BASIC!
  • XKeys — A library that allows BASIC to detect multiple key presses. I've also included a demo that shows how to detect the arrow keys. The readme explains in more detail and includes a key code chart. This was designed with games in mind so it is small, fast, and easy to use. This version does not use interrupts or any safe RAM areas, so it should be safe to use with other libraries.
  • xLIB — An APP that adds functionality to TI-83/4+ BASIC programs. It installs a parser hook which will intercept any real( requests. See the xLIB article for more information about it.
  • Xtravar Beta 1 — Xtravar Beta 1 is a no-shell assembly program that lets you use up to 256 different strings, matrices, pics, etc. It also lets you use special characters. The best part is that you can send your program to other calcs and they won't need this program to run it!
  • ZBASIC Library — ZBASIC is a set of 10 ASM routines which BASIC programs can access and use. These include inverting the screen, getting free RAM amount, setting/checking contrast level, getting battery status, shifting the screen up, etc.
  • ZBTools — Assembly Tools for Basic Programmers. It provides several useful functions for TI-Basic programmers.
  • **Celtic III** -- Celtic III is a Flash Application for the TI-83 Plus, TI-83 Plus Silver Edition, TI-84 Plus, and the TI 84 Plus Silver Edition graphing calculators [ TI-83/84+(SE) , designed to extend the functionality of these calculators so that BASIC games and utilities can perform actions that cannot easily be done through the language itself. Celtic III includes all commands from Xlib and some from OmniCalc.
ZOOMOUT.GIF

Command Summary

Zooms to a larger graphing window with the same center.

Command Syntax

Zoom Out

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 3 to select Zoom Out, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

Outside a program, the Zoom Out tool allows you to pick a point on the graph screen and change the graphing window to a larger one centered at that point. The Zoom Out command, used in a program, also changes the graphing window to a larger one, but doesn't let you pick a point — it uses the center of the screen.

The variables XFact and YFact are used to determine how much the graphing window changes: the total width of the screen, Xmax-Xmin, is multiplied by XFact, and the total height, Ymax-Ymin, is multiplied by YFact. Because you can't store a value less than 1 to either of these variables, the screen is guaranteed to get no smaller.

Aside from Xmin, Xmax, Ymin, and Ymax, no window variables are modified by this command (although ΔX and ΔY change as they are defined).

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program.
  • ERR:ZOOM is thrown if an overflow occurs calculating the new window dimensions (the window is too big)

Related Commands

xLIB is a TI-83+/84+/SE assembly application created by Patrick Prendergast (tr1p1ea), and it adds additional functionality to TI-Basic programs. It works by installing a parser hook which will intercept any real( command requests.

Some of its features include:

  • Fast sprites/tilemapping
  • Faster key routines
  • Scrolling the screen
  • Executing archived programs

Documentation

Unfortunately, there isn't a whole lot of documentation that has been created for xLIB. The three main pieces of documentation that have been created so far include the readme file itself, a tutorial heavily based on the readme, and a masked sprites tutorial explaining how to use xLIB to create masked sprites. We can hopefully create more documentation at some point in the future.

What would happen if there was a background already layed out on the screen, and you wanted to overlay a sprite on top of it? If you use any type of logic to draw the sprite, the background and sprite would get destroyed. Like this:

linkunmasked.png

Do you notice the extra white space around Link, where the background should be? One technique programmers use to prevent this is called Masking. Here's one technique to do this.

Masking with AND

This is the most common technique that even assembly programmers use. What happens is the programmer creates 2 different sprites, one is the actual sprite, the other is a "mask". Here's how you create the mask.

First take a regular sprite like this:
linksprite.png
And fill in the background with black pixels, so it looks like this:
linksprite2.png
Now just XOR the original sprite, so the filled background remains like this:
linkmask.png
The final result gives the mask of the sprite. Save this and the original sprite in a picture.
linkresult.png

Now when you display the sprite, you'd first ''AND'' the Mask to the screen (no update), and then ''XOR'' or ''OR'' the original sprite. The mask will force the pixels that take up the sprite's image off, clearing a space for the sprite, but not overwriting the background. For example:

PROGRAM:Mask
:real(0,0    \\ Clear the screen
:real(2,0,0,0,6,4,0,6,0,4,9,0,16,1    \\ Draws background tilemap stored in Pic9, notice 16*16 mode
:real(1,24,32,2,16,1,0,0,1,0,0    \\ Draws mask
:real(1,24,32,2,16,1,0,16,3,0,1    \\ Draw sprite

If you are considering using xLIB to produce amazing TI-Basic programs, I trust that you are an experienced programmer and already know the basics of TI-Basic programming. If you don’t, then this tutorial will still teach you, but it may not be as easy to understand.

xLIB is a graphical all-around application to enhance TI-Basic programs with the power of assembly. Bundled in xLIB are many useful functions to allow you to use sprites, tilemaps, direct input, and many other features that you see in many assembly games from your TI-Basic programs. It is similar to Detached Solution’s Omnicalc, and if you have experience with Omnicalc, you should have no problem with xLIB.

When you install xLIB, it will install a parser hook that will detect real() requests. All xLIB functions begin with real(, and when the command is executed, the function will be intercepted and carried out by xLIB.

The real( function can be accessed by pressing [MATH] and scrolling to the CPX menu.

Clearing the Screen

This is one of the simplest commands in xLIB. Just enter real(0,1 in your program to quickly clear the screen. You will almost never have to use ClrDraw after this, and, in addition, it also clears the home screen, too!

:real(0,[updateLCD]

updateLCD — This can either be 0 (don’t update the screen; useful for when you want to draw something on the screen with multiple commands and want for your picture to appear all at once) or 1 (update screen). If you want, you can drop this argument and have only real(0, and xLIB will automatically update the screen, and you’ll save two bytes, but there is a small possibility you could get an unexpected result, so do so at your own risk.

:real(0,1

Logic

A logic argument is often required in xLIB, here are the 4 possibilities:

  • 0 represents Overwrite, which means the sprite will overwrite whatever is existing in that location on the screen.
  • 1 represents AND logic. Please refer to the truth table first to try to understand it. Basically, for a pixel to be turned on in the final image, the background pixel must be black, and the sprite pixel must be back, making AND very useful for masking(more about that later)
  • 2 represents OR logic. Please refer to the truth table to find out more. In OR logic, the turned on pixels of the sprite will overlap whatever is on the screen,it's sorta useful when nothing is on the screen, but if there is already a background, it'll overlap it,and then you can't see anything.
  • 3 represents XOR logic. Please refer to the truth table to find out more. In XOR logic,if a pixel is already on in the background, and the sprite's pixel is on too, then it toggles it off.So basically,if pixels overlap,they get toggled on and off. This is an extremely useful feature as you can erase previous drawings of the same sprite on the screen by recalling the sprite again.

Truth Table

AND OR XOR The 1s represent a Turned on Pixel
1 1 1 1 0 The 0s represent a turned off pixel
1 0 0 1 1 The 1st column represents the background
0 1 0 1 1 The 2nd Column represents the Sprite
0 0 0 0 0

Sprites

We will first begin with one of the most useful tools xLIB has to offer: sprite commands. A sprite, in a few words, is an image that you can move around on the screen. If you have ever played a video game, the characters and elements such as people, weapon blasts, coins, bricks, etc. are sprites.

Before you can use the xLIB commands to draw sprites, you must create and store them. Sprites are stored and read from normal TI-OS pictures. xLIB can recall sprites from pictures 1-255, regardless if they're archived or not.

The Sprite Command

Let us look at xLIB's sprite function. It's used to place a single sprite on the screen.

:real(1,[X position],[Y position],[sprite width *],[sprite height],[sprite pic],[X offset *],[Y offset],[drawing logic],[horizontal flip],[update LCD]

Now, do not let the number of arguments of that command scare you into submission; it becomes very simple once you get the hang of it. Let's walk through it, shall we?

real(1 — Indicates you want the sprite command of xLIB.

X Position -– The X-coordinate of where you want the sprite to be displayed on the screen. This can range from 0-95, so you generally want the X-coordinate to be displayed within that range, but xLIB supports clipped sprites, so in some cases you might want the x-coordinate to be larger or smaller than the screen's width.

Y Position — The Y-coordinate of where you want the sprite to be displayed on the screen. This can range from 0-63, but as with the X-coordinate, you may want this to be larger or smaller than the screen's height.

Sprite Width -– The width of your sprite, but this command might fool you at the beginning, because you must enter it in bytes. One byte is equal to 8 pixels, so if you have a sprite that is 1x1 to 8x8 pixels, then the sprite width would be one (1*8==8); a 9x9 to 16x16 pixel sprite would be two (2*8==16), and a 17x17 to 24x24 sprite would be three (3*8==24), and so on. Since you can't use pixel values, you may have some wasted space in the sprite picture, but sprites are generally kept widths as multiples of 8 for this reason. Sprite width can range from 0 to 12 bytes.

Sprite Height — Unlike the sprite width, this is the actual height in pixels of the sprite, so the height of an 8x8 sprite, for example, would be simply be 8. Don't get the values for sprite height and width confused, or you will get an unexpected result. Sprite height can range from 0 to 63 bytes.

Sprite Pic — This is the Pic# in which the sprite is located in. This ranges from 1 to 255. NOTE: xLIB considers 0 to be Pic 10, so entering zero here will actually read from Pic 10.

X Offset — This is the X offset where the sprite you want is located in the picture that the sprite is stored in. Like sprite width, this is the number of bytes from the left to where the sprite is located, so this might confuse you again in the beginning.

Y Offset — Is Y offset of the sprite you want, but is the number of pixels from the top to where the sprite is located.

To explain both X and Y offsets better in one paragraph, let's say you have an 8x8 pix sprite you want to use that is located 56 pixels from the left and 24 pixels from the top of the spritesheet picture. The X offset of that would be 7 bytes (because 7*8==56), and the Y offset would simply be 24 pixels.

Drawing Logic -– This arguments tells xLIB how it should draw the sprite on the screen. There are four possibilities: 0 == overwrite, 1 == and, 2 == Or, 3 == xor. More information can be found in the Logic section.

Horizontal Flip — This argument is either a 1 or 0. If it is 1, then xLIB will draw your sprite horizontally. This is a big time and space saver, as you only would have to draw a character, say, that looks to the left, and use this to flip it when you want the character to look the other direction.

Update LCD -– This argument is the same as it is for clear screen: 1 to update the screen; 0 to not update the screen. An Example:

PROGRAM:DispSprite         \\Displays a sprite at location (24,34) 
:real(1,24,34,1,8,10,0,0,3,0,1  \\from Pic0's top left sprite,uses xor logic,updates screen.

There are many ways to use the sprite command, even with masked sprites!

Tilemapping

One of the strongest features of xLIB is that it supports tilemapping through the request, real(2. First let me explain what tilemapping is. Let's say you have an RPG, and the main character enters a forest, the background of the forest, like all the trees and plants are all part of the tilemap. How do you do that though?

Well, you could store each individual background as a picture and then recall it as you come across it, but that takes up a lot of memory, and also, how would you do collision detection with the trees and plants? The solution programmers come up with is called a tilemap.

The tilemap is a matrix where each tile number corresponds with a particular sprite on a sprite sheet. Thus, you can do collision detection by checking what tile number it is in the tilemap. xLIB supports 8*8 tiles in a tilemap. Thus, a regular tilemap would have dimensions of 8*12. So if I have a tilemap like this

1,0,1,0,1,0,1,0,1,0,1,0
0,1,0,1,0,1,0,1,0,1,0,1
1,0,1,0,1,0,1,0,1,0,1,0
0,1,0,1,0,1,0,1,0,1,0,1
1,0,1,0,1,0,1,0,1,0,1,0
0,1,0,1,0,1,0,1,0,1,0,1
1,0,1,0,1,0,1,0,1,0,1,0
0,1,0,1,0,1,0,1,0,1,0,1

And I have a sprite sheet where tile number "0" corresponds with a blank space, and tile number "1" corresponds with a black square, then if I draw the tilemap to the screen, the screen would look like a checkerboard:

checkerboard.png

Now, let's look at the xLIB function :)

:real(2,Matrix_Name,X_Offset,Y_Offset,MapWidth,MapHeight,ScreenStartX,ScreenEndX,ScreenStartY,ScreenEndY,mPIC_Num,Tile_Method,Tile_Size,Map_UpdateLCD

Matrix name is a number from 0-9. Xlib uses the TIOS matrices for its tilemap. 0 represents matrix [A], 1-[B],etc….9-[J]

X_offset is a number that pinpoints the x-coordinate in the matrix at which xLIB starts reading the tilemap. This is used for scrolling, so for now, you might just want to leave it 0.

Y_offset is a number that pinpoints the y-coordinate in the matrix at which xLIB starts reading the tilemap. This is used for scrolling, so for now, you might just want to leave it at 0.

MapWidth is a number that is the width of the map you want to display. Normally, you'd want to leave the MapWidth at 12, seeing that 12 is the width of the screen.There are a few exceptions, though.

MapHeight is a number that is the height of the map. Normally, you'd want to leave the MapHeight at 8, because 8 is the height of the screen in bytes. There are a few exceptions, though.

ScreenStartX is a number from 0-12 which pinpoints the column on the screen in which you want to start drawing the tilemap. This is used for a "windowed" tilemap. Note that when you're in 16*16 tilemap mode,the values are 0-6 (*16)

ScreenEndX is a number from 0-12 which pinpoints the column on the screen in which you want to end the tilemap. This is used for a "windowed" tilemap. Note that when you're in 16*16 tilemap mode,the values are 0-6 (*16)

ScreenStartY is a number from 0-8 which pinpoints the row in which you want to start drawing the tilemap on the screen. This is used for a "windowed" tilemap. Note that when you're in 16*16 tilemap mode,the values are 0-4 (*16)

ScreenEndY is a number from 0-8 which pinpoints the row in which you want to stop drawing the tilemap on the screen. This is used for a "windowed" tilemap. Note that when you're in 16*16 tilemap mode, the values are 0-4 (*16)

NOTE: The above 4 arguments are all in bytes.

mPic_Num is the PicNumber in which the tiles for the tilemap are located. Now in the Pic, the top left 8*8 sprite is tile0 (NOT tile1). Then the sprite at right of it (at 8,0) is tile1, the one right of that one (at 16,0) is tile2. Thus, in the picture, the first row of sprites are tiles 0-11, then the second row is tiles 12-23 and so on.

Now, an excellent feature of xLIB is that it can read picture data that is archived, and it supports multiple picture data! What does that mean? An ordinary picture has 12*8, 96 tiles. What if that isn't enough? Well, xlib can support unlimited tiles (actually 65536 tiles) so the picture after mPic_Num contains the next tiles 96-191.

TileMethod is basically the same as the "logic" argument of the sprite function. 0 = Overwrite, 1 = AND, 2 = OR, 3 = XOR

TileSize is an interesting argument. A "0" (or basically omit the argument) represents a tilesize of 8*8, the regular mode. If the number is "16" instead, it represents you want the normal tile size to be 16*16. This will change several of the other arguments in the tilemap function. What's the use of this? Well first of all, some games will have 16*16 tiles, so instead of forming 4 8*8 tiles in a matrix, you can have just one 16*16 tile. This allows for smaller matrix sizes and saves a lot of space.

Map_UpdateLCD is the same as all the other UpdateLCD's. "0" represents no, "1" represents yes, the current screen data will be updated.

PROGRAM:TileMap
:[[1,0,1,0,1,0,1,0,1,0,1,0]   //Store the tiledata to [A]
[0,1,0,1,0,1,0,1,0,1,0,1]
[1,0,1,0,1,0,1,0,1,0,1,0]
[0,1,0,1,0,1,0,1,0,1,0,1]
[1,0,1,0,1,0,1,0,1,0,1,0]
[0,1,0,1,0,1,0,1,0,1,0,1]
[1,0,1,0,1,0,1,0,1,0,1,0]
[0,1,0,1,0,1,0,1,0,1,0,1→[A]
:real(0,0
:real(2,0,0,0,12,8,0,12,0,8,1,0,8,1   //Draw the tiles to the screen, 12*8 tilemap

If you run this program and you have a black square as tile 0 in Pic1, then it will draw the following screen:

checkerboard.png

Recalling Pics

Recalling pics can be a very useful ability for a number of functions. The syntax is as follows:

:real(3,rPIC_Num,rPIC_Method,Recall_UpdateLCD

rPIC_Num is the picture you wish to recall.

rPIC_Method is the method you wish to use to recall, 0 for overwrite, 1 for AND (draws white for on pixels), 2 for OR (draws black for on pixels), or 3 for XOR (which inverts on pixels) like always.

Recall_UpdateLCD is the same as all the other UpdateLCD's. 0 represents no, 1 represents yes, the current screen data will be updated.

So, you may be wondering how this could be useful. One very obvious use is grayscale splash screens. If you have two pictures, lets say pic 0 and 1, you could switch between which is displayed within a loop, thus resulting in a gray effect where there is difference between the two pictures.

:Repeat A
:real(3,0,0,1
:getKey→A
:real(3,1,0,1
:End
dithering.png

In Assembly programming, they have use of a buffer, basically another extra screen to work with. In normal TI-Basic, we don't have access to that, but we can essentially use pictures as buffers. One example of this is a background image to a game, you can save it in a separate picture, then recall it each time you want the background displayed.

Another code you can use uses the xor logic:

real(3,0,0,1
Repeat getkey
real(3,1,3,1
End

Screen Scrolling

Screen scrolling is a very basic function, although it is very handy in some situations.

:real(4,Scrl_Direction,Scrl_Number,Scrl_UpdateLCD

Scrl_Direction = The direction in which the screen scrolls.
Scrl_Number = The number of pixels the screen scrolls.
Scrl_UpdateLCD = Toggles a LCD update. 0 is no, 1 is yes.

The following numbers are what you put in place of Scrl_Direction, to tell the calculator which way you want your screen to move.

0 1 2 3 4 5 6 7
Up Down Left Right Up-Left Up-Right Down-Left Down-Right
:real(4,3,5,1

The code above will scroll the screen right 5 pixels, then toggle a LCD update.

The Contrast

The contrast isn't all that hard to do inside TIOS, although if you want to set it to a certain level, or see what level you're on, this code is for you.

:real(5,Contrast_Function,ContrastVal

Contrast_Function = The action to take, shown below.

0 = Sets the contrast level.
1 = Get the contrast level.

ContrastVal = New contrast value. Can be a value from 0-39

If you're setting the contrast, then you need to input a number for ContrastVal.

If you're just getting the contrast, then you don't need to. When you do get the contrast, the level is stored in Ans.

If you were to merely get the contrast level, you would input the following:

:real(5,1

Then, you would simply type in Ans, and then it will show you the level of contrast. Otherwise, if you were to type in:

:real(5,0,26

Then that would set your contrast to level 26. Simple, I know.

xLIB Detection

If someone does not have xLIB installed, it may be difficult to alert them to this. To check for xLIB installation, the following code will work.

:1
:real(0
:If not(Ans:Then
:Disp "XLIB NOT ENABLED
:Stop
:End

In the case that xLIB is not installed, the message "XLIB NOT ENABLED" will be displayed and the program will quit. Otherwise, operation occurs normally.

Collision Detection

Collision detection is a necessity if you're going to make a graphic RPG, or any other game.

You can create collision detection many different ways. For instance; lists. If you wanted to use lists you would have to store all of the coordinates into a list, and then use if statements to check if the character is on that spot. Even though you can do collision detection with lists, I wouldn't reccomend it. The problem with using lists is that they aren't very memory efficient. That's why we are going to use the fPart( command.

The fPart( command grabs the decimal part of a variable. Which means we can add decimals in the Tilemap where the character isn't supposed to stand. Here's an example of the decimals in the Tilemap.

[[1,0,1.01,0,1,0]
[0,1,0,1,0,1]
[1,0,1,0,1,0]
[0,1,0,1,0,1]       //Tilemap in matrix [A]
[1,0,1,0,1,0]
[0,1,0,1,0,1]

Here is the code example for detecting the decimal.

//character movement
If .01=fPart([A](X,Y:Then     //(X,Y are the location of the character) if the decimal of X,Y in the tilemap equals .01/a border then
//don't let the character move
End

Using the fPart( command you can also do detection for special spaces. For example a door. The decimal .01 can stand for a place you can't walk into, and .02 can stand for a door.

If .02=fPart([A](X,Y:Then     // If the decimal of X,Y in the tilemap equals .02/a door then
//enter the building or room

Using collision detection you can create much more than borders and doors. You can create many other spaces, such as coins, portals, water, etcetera.

Memory Functions

Get RAM value

:real(4

Reset RAM (Crash)

:real(34

xLIB is now an APP that adds some functionality to TI-83+ BASIC programs. It installs a parser hook which will intercept any real( requests.

To install xLIB simply copy xLIB.8xk to your calculator using your favorite flavor of linking software.

To enable xLIB you must run it from the APPS menu and select "1". A message should appear informing you that xLIB has been enabled. Pressing "2" will disable xLIB and "3" will quit.

xLIB uses both SavesScreen and AppBackupScreen, if you have any other libs that use those saferam areas the results could be unpredictable.

0- ClearScreen

:real(0,Clr_UpDateLCD

Clr_UpdateLCD = Toggle LCD update: 0 = No, 1 = Yes

This function Clears the graph buffer and the LCD.

1- DrawSprite

:real(1,Spr_X,Spr_Y,Spr_Width,SprHeight,sPIC_Num,sPIC_X,sPIC_Y,Spr_Method,Spr_Flip,Spr_UpDateLCD
Spr_X Sprite X location
Spr_Y Sprite Y location
Spr_Width Sprite width in bytes (so a 16 pixel wide sprite would have a width of 2)
Spr_Height Sprite height in pixels
sPIC_Num The picture in which the sprite is located PIC0 - PIC9
sPIC_X X offset to sprite in PIC, must be ALIGNED. Can be a value from 0-11
sPIC_Y Y offset to sprite in PIC
Spr_Method The copy method 0 = Overwrite, 1 = AND, 2 = OR, 3 = XOR
Spr_Flip = Flip Sprite 0 No Flip, 1 = Horizontal Flip
Spr_UpdateLCD Toggle LCD update 0 = No, 1 = Yes

This function will draw clipped sprites of ANY size anywhere on the screen.

Don't forget that sprites always have a width which is a multiple of 8. However with this routine we want the byte width of the sprite. It is 8 pixels per byte! So a 8x8 sprite has a byte width of 1, a 16x16 sprite would have a byte width of 2. A 12x12 sprite would still occupy 2 byte so it also has a byte width of 2.

sPIC_X is only at ALIGNED positions, can be a value from 0-11
sPIC_Y can be from 0-63

Horizontal Sprite Flipping has now been implemented. This should save you some space.

This function will still be able to read PIC data even if it is archived!

2- DrawTileMap

:real(2,Matrice_Name,X_Offset,Y_Offset,MapWidth,MapHeight,ScreenStartX,ScreenEndX,ScreenStartY,ScreenEndY,mPIC_Num,Tile_Method,Tile_Size,Map_UpdateLCD
Matrice_Name Name of matrice containing map data 0 - 9. 0 = [A] - 9 = [J]
X_Offsett X Map Offsett. Which part of the map you wish to start drawing at
Y_Offsett Y Map Offsett. Which part of the map you wish to start drawing at
MapWidth Width of TileMap
MapHeight Height of TileMap
ScreenStartX Which COLUMN you wish to START drawing. Can be a value from 0-12 for 8x8 or 0-6 for 16x16
ScreenEndX Which COLUMN you wish to END drawing at. Can be a value from 0-12 for 8x8 or 0-6 for 16x16
ScreenStartY Which ROW you wish to START drawing. Can be a value from 0-8 for 8x8 or 0-4 for 16x16
ScreenEndY Which ROW you wish to END drawing at. Can be a value from 0-8 for 8x8 or 0-4 for 16x16
mPIC_Num The PIC in which the tile data is located PIC0 - PIC255
Tile_Method The copy method 0 = Overwrite, 1 = AND, 2 = OR, 3 = XOR
Tile_Size Size of tiles, 8 = 8x8, 16 = 16x16
Map_UpdateLCD Toggle LCD update 0 = No, 1 = Yes

The ScreenStartX, ScreenEndX, ScreenStartY, ScreenEndY enable you to draw a 'windowed' map. This means that you can draw your map and leave space for a HUD or something similar. Drawing smaller maps will also be a little faster.

To draw an 8x8 tilesize map centered with a 1 tile blank border the inputs would be:

ScreenStartX 1
ScreenEndX 11
ScreenStartY 1
ScreenEndY 7

The TileMap routine now supports MULTIPLE PICS and 16-bit TILE INDEXES. This means that you can have a map with more than 256 different tiles. If a tile is >95 it will overlap to the next PIC (if it exists).

PICS must follow each other numerically!

So if your input PIC is PIC0 any tiles > 95 will be taken from PIC1 and any tiles > 191 will be taken from PIC2.

If the PIC doesn't exist then the tile will be drawn as a BLANK.

This function will still be able to read PIC data even if it is archived! But it may slow things down.

3- RecallPIC

:real(3,rPIC_Num,rPIC_Method,Recall_UpdateLCD
rPIC_Num PIC to recall PIC0 - PIC255
rPIC_Method The copy method 0 = Overwrite, 1 = AND, 2 = OR, 3 = XOR
Recall_UpdateLCD Toggle LCD update 0 = No, 1 = Yes

This will recall a pic and display it with some options (OR, XOR etc)

This function will still be able to read PIC data even if it is archived!

4- ScrollScreen

:real(4,Scrl_Direction,Scrl_Number,Scrl_UpdateLCD
Scrl_Direction direction to scroll
Scrl_Number number of pixels to scroll
Scrl_UpdateLCD Toggle LCD update 0 = No, 1 = Yes

Directions

0 1 2 3 4 5 6 7
Up Down Left Right Up-Left Up-Right Down-Left Down-Right

5 - ChangeContrast

:real(5,Contrast_Function,ContrastVal
Contrast_Function Contrast returned in Ans (0-39). 0 = Set Contrast, 1 = Get Contrast
ContrastVal New contrast value. Can be a value from 0-39

6 - UpdateLCD

:real(6

This function will copy the graph buffer to the LCD

7 - RunIndicator

:real(7,runIndicVal
runIndicVal Toggle Run Indicator. 0 = Off, 1 = On

8 - getKey

:real(8

Scans the keypad and returns a key code in the ANS variable.

Has support for multiple arrow keypresses.

Key Codes
xlib-keys.png

9 - CreatePIC

:real(9,cPIC_Funtion,cPIC_Num
cPIC_Function Function to perform. 0 = StorePIC, 1 = DeletePIC
cPIC_Num Number of PIC file to store to. Ranges from 1-255

NOTE: PIC0 is actually PIC10 according to the TIOS. To store to PIC0 use:

:real(9,10

IMPORTANT: Because the pics use tokens in their name that the TIOS doesn't really have (for PICS) the names in your memory management will be all strange. For example:

PIC0
inString(
P/Y
Z-Test(

This is perfectly normal, nothing is wrong with your calculator. The TIOS just doesn't have the names for PIC variables above the 10th.

To transfer these pics to your calculator, you must group them. Sending may fail if you attempt to send them individually.

10 - ExecuteArchivedProg

:"PRGMNAME:real(10,exAction,Prgm_Dest:prgmXTEMP0XX
"PRGMNAME Name of program to be stored in the Ans variable. Program can be archived or in RAM
exAction Action to perform. 0 = copy, 1 = clean specific, 2 = clean all
Prgm_Dest Destination XTEMP program. Ranges from 0-15

This function will copy a program from the archive or RAM to one of 16 XTEMP programs. The name of the
program to copy must be stored in the Ans variable prior to running this function.

This function will work with TI-Basic and TIOS ASM (nostub) programs.

For example, to copy the TI-Basic program ADEMO to XTEMP000 you would do:

:"ADEMO
:real(10,0,0

To copy the TI-Basic program MAP1 to XTEMP011, and then RUN XTEMP011 you would do:

:"MAP1
:real(10,0,11
:prgmXTEMP011

To copy the TIOS ASM program SCROLL to XTEMP009, and then RUN XTEMP009 you would do:

:"SCROLL
:real(10,0,11
:Asm(prgmXTEMP011

To remove program XTEMP006 you would do:

:real(10,1,6

To remove all XTEMP0XX programs you would do:

:real(10,2,0

NOTE: If the XTEMP0XX program already exists (in RAM or archive), then this function will exit without copying. You must manually remove the target program before attempting to replace it. (This is to stop accidents with nested programs trying to replace themselves).

11 - GetCalcVersion

:real(11

Returns a code in the ANS variable which will tell you what calculator version you are running.

0 1 2 3
83+ 83+SE 84+ 84+SE

12 - DrawShape

:real(12,Shape_Type,x1,y1,x2,y2,DrawShape_UpdateLCD
Shape_Type Type of Shape you want to draw:
Number
0 DrawSingleLineBlack
1 DrawSingleLineWhite
2 DrawSingleLineInvert
3 DrawEmptyRectangleBlack
4 DrawEmptyRectangleWhite
5 DrawEmptyRectangleInvert
6 DrawFilledRectangleBlack
7 DrawFilledRectangleWhite
8 DrawFilledRectangleInvert
9 DrawRectOutlineBlackFillWhite
10 DrawRectOutlineWhiteFillBlack
Position
x1 First x coord (for rectangles this is TOP LEFT corner)
y1 First y coord (for rectangles this is TOP LEFT corner)
x2 Second x coord (for rectangles this is BOTTOM RIGHT corner)
y2 Second y coord (for rectangles this is BOTTOM RIGHT corner)
DrawShape_UpdateLCD Toggle LCD update 0 = No, 1 = Yes

13 - TextMode

:real(13,Text_Mode
Text_Mode Change the text mode: 0 = Normal, 1 = Inverse, 2 = Lowercase on, 3 = Lowercase off

When Lowercase is enabled, press ALPHA twice to enter lowercase mode in the TIOS.

NOTE: Some TIOS functions (like errors and some menus) automatically reset these text flags to Normal.

14 - CheckRAM

:real(14

Returns the amount of FREE RAM in ANS

WARNING: You MUST provide the correct inputs for each function. If you do not, you risk a crash or worse.

Do NOT try to run your TI-Basic from MirageOS! I use a saferam area that MirageOS uses, so it may cause instability.

Credits & Thanks

Dan Weiss (DWedit): APP Devkit 2.0
Dan Englender (Dan_E): WikiTI
Sean McLaughlin (Sigma): Ideas for masked/clipped sprite routine without smc
Patai Gergely (CoBB): PindurTI, greatest 83+ emulator by far
Badja: Initial Clipped line routine
James Montelongo (Jim e) & YUKI: DI wrapper routine ideas
Texas Instruments (TI): SDK and System Routine Documentation
Kevin Ouellet (Kevin, xlibman): Testing & ideas
George Daole-Wellman (Dysfunction): Testing & ideas
Kalan Scallan (kalan_vod): Testing & ideas
Fred Sparks (CDI, [froody]): Testing & ideas
threefingeredguy: Testing & ideas
Shaun McFall (Merthsoft): Testing & ideas
Fred Shen (dragon_lance): Testing & ideas
Brian Benson (Necro): Testing & ideas
Everyone on MaxCoderz Forums
Everyone in #TCPA (EfNet)

If I forgot you, please email me and I will update this section.

Disclaimer

This program is still in early stages and may contain bugs. Program is use at own risk, I can not be held responsible for loss of data and or hardware damage.

If you have any questions please email me at <ua.moc.oohay|ae1p1rt#ua.moc.oohay|ae1p1rt>

I have no problem with anyone using this program as long as you credit me properly. Please don't try to modify and/or pass this program off as your own with out first gaining my consent.

tr1p1ea — 04/02/2006 (DD/MM/YYYY)

LESSTHANEQUAL.PNG

Command Summary

Returns true if value1 is less than or equal to value2.

Command Syntax

value1value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. 6 to select ≤, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ≤ (less than equal) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value less than or equal to the second one. It will return 1 if it is less than or equal to, and 0 if it is not. When determining the order of operations, ≤ will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

:1≤0
           0

:DelVar X3→Y
:X≤Y
           1

Advanced Uses

Just like the other relational operators, ≤ can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

:{2,4,6,8}≤{1,3,5,7
           {0 0 0 0}
:5≤{1,2,3,4,5
           {0 0 0 0 1}

Unfortunately, ≤ does not work with strings, matrices, or complex numbers (only = and do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

Error Conditions

  • ERR:DATA TYPE is thrown if you try to compare strings, matrices, or complex numbers.
  • ERR:DIM MISMATCH is thrown if you try to compare two lists that have different dimensions.

Related Commands

  • = (equal)
  • (not equal)
  • > (greater than)
  • (greater than equal)
  • < (less than)
LESSTHAN.PNG

Command Summary

Returns true if value1 is less than value2.

Command Syntax

value1<value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. 5 to select <, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The < (less than) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value less than the second one. It will return 1 if it is less than, and 0 if it is not. When determining the order of operations, < will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

:1<0
           0

:DelVar X3→Y
:X<Y
           1

Advanced Uses

Just like the other relational operators, < can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

:{2,4,6,8}<{1,3,5,7
           {0 0 0 0}
:5<{1,2,3,4,5
           {0 0 0 0 0}

Unfortunately, < does not work with strings, matrices, or complex numbers (only = and do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

Error Conditions

  • ERR:DATA TYPE is thrown if you try to compare strings, matrices, or complex numbers.
  • ERR:DIM MISMATCH is thrown if you try to compare two lists that have different dimensions.

Related Commands

  • = (equal)
  • (not equal)
  • > (greater than)
  • (greater than equal)
  • (less than equal)
GREATERTHANEQUAL.PNG

Command Summary

Returns true if value1 is greater than or equal to value2.

Command Syntax

value1value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. 4 to select ≥, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The (greater than equal) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value greater than or equal to the second one. It will return 1 if it is greater than or equal to, and 0 if it is not. When determining the order of operations, will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

:1≥0
           1

:DelVar X3→Y
:X≥Y
           0

Advanced Uses

Just like the other relational operators, can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

:{2,4,6,8}≥{1,3,5,7
           {1 1 1 1}
:5≥{1,2,3,4,5
           {1 1 1 1 1}

Unfortunately, does not work with strings, matrices, or complex numbers (only = and do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

Error Conditions

  • ERR:DATA TYPE is thrown if you try to compare strings, matrices, or complex numbers.
  • ERR:DIM MISMATCH is thrown if you try to compare two lists that have different dimensions.

Related Commands

  • = (equal)
  • (not equal)
  • > (greater than)
  • < (less than)
  • (less than equal)
GREATERTHAN.PNG

Command Summary

Returns true if value1 is greater than value2.

Command Syntax

value1>value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. 3 to select >, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The > (greater than) operator takes two numbers, variables, or expressions, and tests to see if the first one has a value greater than the second one. It will return 1 if it is greater, and 0 if it is not. When determining the order of operations, > will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

:1>0
           1

:DelVar X3→Y
:X>Y
           0

Advanced Uses

Just like the other relational operators, > can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

:{2,4,6,8}>{1,3,5,7
           {1 1 1 1}
:5>{1,2,3,4,5
           {1 1 1 1 0}

Unfortunately, > does not work with strings, matrices, or complex numbers (only = and do), and the calculator will actually throw a ERR:DATA TYPE error if you try to compare them. In the case of strings, however, it should be pretty obvious why: a string represents a sequence of characters, and does not associate a value to any character, so there is nothing to compare.

Error Conditions

  • ERR:DATA TYPE is thrown if you try to compare strings, matrices, or complex numbers.
  • ERR:DIM MISMATCH is thrown if you try to compare two lists that have different dimensions.

Related Commands

  • = (equal)
  • (not equal)
  • (greater than equal)
  • < (less than)
  • (less than equal)
NOTEQUAL.PNG

Command Summary

Returns true if value1 is not equal to value2.

Command Syntax

value1value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. 2 to select ≠, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ≠ (not equal) operator takes two numbers, variables, or expressions, and tests to see if they are not equal to each other. It will return 1 if they are not, and 0 if they are. When determining the order of operations, ≠ will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

1≠0
           1
0→X
           0
3→Y
           3
X≠Y
           1

Advanced Uses

Just like the other relational operators, ≠ can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

:{2,4,6,8}≠{1,3,5,7
           {1 1 1 1}
:5≠{1,2,3,4,5
           {1 1 1 1 0}

Besides real numbers and lists, ≠ also allows you compare strings, matrices, and complex numbers. However, the variables must be of the same type, otherwise the calculator will throw a ERR:DATA TYPE error; and just like with lists, both matrices must have the same dimensions, otherwise you will get a ERR:DIM MISMATCH error.

:[[1,2,3]]≠[[1,2,3
           0
:"HELLO"≠"WORLD
           1
:(3+4i)≠(5-2i)    (the parentheses are added for clarity)
           1

Optimization

Don't compare a variable's value to zero in a conditional expression, because the calculator treats nonzero values as true and zero as false. Instead, just write the variable by itself:

:If C≠0
can be
:If C

Error Conditions

  • ERR:DATA TYPE is thrown if you try to compare two different kinds of variables, such as a string and number or a list and matrix.
  • ERR:DIM MISMATCH is thrown if you try to compare two lists or matrices that have different dimensions.

Related Commands

  • = (equal)
  • > (greater than)
  • (greater than equal)
  • < (less than)
  • (less than equal)
EQUAL.PNG

Command Summary

Returns true if value1 is equal to value2.

Command Syntax

value1=value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. 1 to select =, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The = (equal) operator takes two numbers, variables, or expressions, and tests to see if they are equal to each other. It will return 1 if they are, and 0 if they are not. When determining the order of operations, = will be executed after the math operators, but it will be executed before the logical operators and in the order that it appears from left to right with the other relational operators.

1=0
           0
0->X
           0
3→Y
           3
X=Y
           0

Advanced Uses

Just like the other relational operators, = can take real numbers and lists for variables. In order to compare the lists, however, both must have the same dimensions; if they don't, the calculator will throw a ERR:DIM MISMATCH error. When comparing a real number to a list, the calculator will actually compare the number against each element in the list and return a list of 1s and 0s accordingly.

{2,4,6,8}={1,3,5,7
           {0 0 0 0}
5={1,2,3,4,5
           {0 0 0 0 1}

Besides real numbers and lists, = also allows you compare strings, matrices, and complex numbers. However, the variables must be of the same type, otherwise the calculator will throw a ERR:DATA TYPE error.

[[1,2,3]]=[[1,2,3
                      1
"HELLO"="WORLD
                      0
(3+4i)=(5-2i)
                      0

When matrices are compared, the result is 1 if the matrices are identical. Both matrices must have the same dimensions, otherwise you will get a ERR:DIM MISMATCH error. Internally, the calculator compares values from the bottom right of each matrix, moving left across each row from bottom to top. If unequal elements are found, the calculator returns 0 without examining the rest of the matrix.

Optimization

When a variable is used in a conditional statement, and the only values that are possible for a variable are 1 and 0, you can get rid of the = sign and simply use the variable by itself.

:If X=1
can be
:If X

Error Conditions

  • ERR:DATA TYPE is thrown if you try to compare two different kinds of variables, such as a string and number or a list and matrix.
  • ERR:DIM MISMATCH is thrown if you try to compare two lists or matrices that have different dimensions.

Related Commands

  • (not equal)
  • > (greater than)
  • (greater than equal)
  • < (less than)
  • (less than equal)
NEGATIVE.GIF

Command Summary

Returns the negative value of a number.

Command Syntax

value

Menu Location

Press [(-)]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ‾ (negative) operator takes one number, variable, or expression and negates its value, thus returning the negative equivalent of it. The ‾ operator appears higher in the order of operations than both the relational and logical operators, so it will be executed first. In addition, it has the same order of operation as the other math operators, so the calculator simply executes them left to right in the order that they appear.

:‾1
           -1

:5→X
:‾3(X+2
           -21

:‾2→A:‾3→B
:AB
           6

Optimization

When adding a negative number to a positive number, switch the two numbers around and change the addition to subtraction. This allows you to get rid of the ‾ sign and save a byte.

:‾A+B→C
can be
:B-A→C

This is not always the case, however: if you subtract a command that uses a lot of parentheses and is followed by a newline/colon/STO→ arrow, it'd save space to put the subtraction at the beginning of the line. For instance:
:inString(Ans,sub(Str1,1,1+int(log(A))))-1
can be
:‾1+inString(Ans,sub(Str1,1,1+int(log(A

Error Conditions

If an ERR:SYNTAX is being thrown near a subtraction or negation where there should be no errors, check to make sure that ‾ (negation) and - (subtraction) were not swapped by mistake.

Related Commands

STORE.GIF

Command Summary

Stores a value to a variable.

Command Syntax

ValueVariable

Menu Location

Press [STO►]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The → (store) command will store a number, variable, or expression to a variable, using the respective value(s) of the variable(s) at the time. When storing a value in a variable, you have the value on the left side of → and the variable that it will be stored to on the right side.

:1→X
           1

:{1.3,5.7,9.11→ABC
           {1.3 5.7 9.11}

:"HELLO WORLD→Str1
           "HELLO WORLD"

Advanced

It's not easy to put a → symbol into a string, since "→→Str1 would produce a syntax error (and in general, when the calculator 'sees' a → symbol, it assumes that the string is over, and interprets the symbol literally).

However, you can use Equ►String( (outside a program) to get the → or " symbols in a string:

  1. Type them on the home screen and press [ENTER]
  2. Select 1:Quit when the ERR:SYNTAX comes up.
  3. Press [Y=] to go to the equation editor.
  4. Press [2nd] [ENTRY] to recall the symbols to Y1
  5. Now, use Equ►String(Y1,Str1) to store the symbols to a string.

Optimization

You can remove closing parentheses, braces, brackets, and quotes that are before a → command.

:"Hello"→Str1
can be
:"Hello→Str1

Related Commands

ZOOMIN.GIF

Command Summary

Zooms to a smaller graphing window with the same centre.

Command Syntax

Zoom In

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 2 to select Zoom In, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

Outside a program, the Zoom In tool allows you to pick a point on the graph screen and change the graphing window to a smaller one centered at that point. The Zoom In command, used in a program, also changes the graphing window to a smaller one, but doesn't let you pick a point — it uses the center of the screen.

The variables XFact and YFact are used to determine how much the graphing window changes: the total width of the screen, Xmax-Xmin, is divided by XFact, and the total height, Ymax-Ymin, is divided by YFact. Because you can't store a value less than 1 to either of these variables, the screen is guaranteed to get no larger.

Aside from Xmin, Xmax, Ymin, and Ymax, no window variables are modified by this command (although ΔX and ΔY change as they are defined).

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program.
  • ERR:WINDOW RANGE is thrown if the window is zoomed in beyond the level of the calculator's precision.

Related Commands

DIVIDE.GIF

Command Summary

Returns the division of two numbers.

Command Syntax

value1 / value2

Menu Location

Press [/]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The / (divide) operator takes two numbers, variables, or expressions and divides them, thus returning a single new value. The / operator appears higher in the order of operations than both + and -, so if those appear in an expression, / will be executed first. In addition, the * operator has the same order of operations as /, so the calculator simply executes them left to right in the order that they appear.

:1/1
           1

:5→X
:2/3X
           3.333333333

:2→A:3→B
:A/B/B/A
           .1111111111

Related Commands

Error Conditions

MULTIPLY.GIF

Command Summary

Returns the multiplication of two numbers.

Command Syntax

value1 * value2

Menu Location

Press [*]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The * (multiply) operator takes two numbers, variables, or expressions and multiplies their values together, thus returning a single new value. The * operator appears higher in the order of operations than both + and -, so if those appear in an expression, * will be executed first. In addition, the / operator has the same order of operations as *, so the calculator simply executes them left to right in the order that they appear.

:1*1
           1

:5→X
:2*3X
           30

:2→A:3→B
:A/B*B/A
           1

Advanced Uses

As it turns out, the most advanced way to use * is by not using it at all. On z80-based TI calculators, two adjacent expressions or variables are implicilty multiplied even without a * mark.

:5*A
should be
:5A

:5*cos(N*θ
should be
:5cos(Nθ

There are a few cases in which omitting the multiplication sign doesn't work. For example, 2^4*E3 (which evaluates to 16000) can't be replaced by 2^4E3, since the latter is interpreted as 2^(4000).

Optimization

The * sign has the same truth value as the and operator because they both return zero if one or more of the numbers is zero (based on Boolean logic). Consequently, you sometimes see people implicitly multiplying expressions together in conditionals and loops, instead of joining them together with and. Unfortunately, this is not only usually larger in size, but often times slower.

:If (A=2)(B=7
should be
:If A=2 and B=7

It does save some space when you can avoid using parentheses:

:If A and B
could be
:If AB

Timing

The amount of time taken to multiply two real floating-point numbers varies with the sum of the digits (including in the fractional part) of the right argument. On a 15 MHz calculator, a single multiplication in the worst case (when the right argument is 99999999999999) takes 3.3 ms, the best case (when the right argument is 0) takes about 0.1 ms, and the average case (for fourteen-digit floating point numbers) takes about 1.7 ms.

These timings do not include parser overhead or variable recall time, which are often significant in overall program speed.

Related Commands

SUBTRACT.GIF

Command Summary

Returns the difference between two numbers.

Command Syntax

value1 - value2

Menu Location

Press [-]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The - (subtract) operator takes two numbers, variables, or expressions and subtracts one from the other, thus returning the difference between them. The - operator appears lower in the order of operations than both * and /, so if those appear in an expression, they will be executed first. In addition, the + operator has the same order of operations as -, so the calculator simply executes them left to right in the order that they appear.

:1-1
           0

:5→X
:2-3X
           -13

:2→A:3→B
:A/B-B/A
           -.8333333333

Error Conditions

  • ERR:SYNTAX is thrown if you try to use - (subtract) in place of (negative). Because they look very similar, it's easy to get this error; at the same time, it's an easy error to fix.

Related Commands

ADD.GIF

Command Summary

Returns the sum of two numbers, or joins two strings together.

Command Syntax

value1 + value2

string1 + string2

Menu Location

Press [+]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The + (add) operator takes two numbers, variables, or expressions and adds their values together, thus returning a single new value. The + operator appears lower in the order of operations than both * and /, so if those appear in an expression, they will be executed first. In addition, the - operator has the same order of operations as +, so the calculator simply executes them left to right in the order that they appear.

:1+1
           2

:5→X
:2+3X
           17

:2→A:3→B
:A/B+B/A
           2.166666667

Advanced Uses

The + operator is overloaded (meaning it has more than one function) by the calculator, and it can be used to put strings together. The strings can consist of whatever combination of text and characters that you want, but it unfortunately does not allow you to join a string to a number (i.e., "Hello5" cannot be made with "Hello"+5).

:"HELLO"+"WORLD
           "HELLOWORLD

:"TI"+"-"+"BASIC
           "TI-BASIC

Related Commands

PI.PNG

Command Summary

The mathematical constant π

Command Syntax

π

Menu Location

Press 2nd π to paste the π symbol.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The π constant on the calculator approximates the mathematical constant π (pi), defined as the ratio of a circle's circumference to its diameter. It's fairly important in many areas of mathematics, but especially trigonometry. Probably the most common use of π on the TI-83 series calculators is for dealing with angles in radian form.

The approximate value of π stored on the calculator is 3.1415926535898.

Related Commands

ZSTANDARD.GIF

Command Summary

Restores window settings to the default.

Command Syntax

ZStandard

Menu Location

Press:

  1. ZOOM to access the zoom menu.
  2. 6 to select ZStandard, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ZStandard command resets all window variables found in the Window screen to their default values. This means that, unlike the other zoom commands, ZStandard can affect variables other than Xmin, Xmax, Ymin, and Ymax. However, it will only affect variables that have a purpose in the current graphing mode. Here are the default values set by ZStandard:

In all modes:

  • Xmin=-10
  • Xmax=10
  • Xscl=1
  • Ymin=-10
  • Ymax=10
  • Yscl=1

Only in Func mode:

  • Xres=1

Only in Param mode:

  • Tmin=0
  • Tmax=2π (in Radian mode) or 360 (in Degree mode)
  • Tstep=π/24 (in Radian mode) or 7.5 (in Degree mode)

Only in Polar mode:

  • θmin=0
  • θmax=2π (in Radian mode) or 360 (in Degree mode)
  • θstep=π/24 (in Radian mode) or 7.5 (in Degree mode)

Only in Seq mode:

  • nMin=1
  • nMax=10
  • PlotStart=1
  • PlotStep=1

These settings are often useful as a "lowest common denominator" that will work fairly well for all graphs.

Advanced Uses

ZStandard is often used before commands such as ZSquare or ZInteger in programs. This serves two purposes: it makes sure that the center of the screen for ZSquare and ZInteger is (0,0), and it ensures that the graph screen is cleared without having to resort to ClrDraw (because with two different zooms in a row, the window settings have to change at least once, which means the graph will have to be regraphed)

Error Conditions

  • ERR:INVALID occurs if this command is used outside a program.

Related Commands

The Zoom commands are found in the menu you get by pressing ZOOM. They are used to manipulate the window variables to change the bounds of the graphing window. With the exception of ZStandard, ZoomSto, and ZoomRcl, these commands only affect the variables universal to all graphing modes: Xmin, Xmax, Xscl, Ymin, Ymax, and Yscl. They ignore the variables specific to a single graphing mode:

  • Xres (only used in Func mode)
  • Tmin, Tmax, and Tstep (only used in Param mode)
  • θmin, θmax, and θstep (only used in Polar mode)
  • nMin, nMax, PlotStart, and PlotStep (only used in Seq mode)

Zoom Variables

Virtually every window variable has a z-equivalent (ZXmin for Xmin, ZPlotStart for PlotStart, etc.) that are found under VARS|2:Zoom… — these are used by ZoomSto and ZoomRcl. Also, the variables XFact and YFact (found under VARS|1:Window…) are used by Zoom In and Zoom Out.

Commands

The commands themselves are only available in programs. Outside it, you can only choose the equivalent menu option (which doesn't leave an entry on the homescreen, and sometimes slightly differs in effect) — this happens, even if you choose the command from the catalog. Of course, with a bit of trickery, you can get the command token itself on the homescreen, but then ERR:INVALID will be thrown if you try to use it. The Trace command also works this way.

The following zoom commands are available:

ASMCOMP.GIF

Command Summary

Compresses an assembly program in hexadecimal form into binary form.

Command Syntax

Asm(prgmORIGINAL,prgmRESULT)

Menu Location

This command is only found in the catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. Scroll down to AsmComp( and press enter.

Calculator Compatibility

TI-83+/84+/SE/CSE/CE

(not available on the regular TI-83)

Token Size

2 bytes

This command is used to compress an assembly program written using AsmPrgm into an "assembled" assembly program. This will make the program about twice as small, and protect it from being edited, in addition to making execution faster.

To use AsmComp(, give it the ASCII represented assembly program, followed by the name you want the assembled program to have. That name can't be already taken. Since it's not easy to rename an assembled assembly program, if you want to write a program called prgmGAME, you type the ASCII represented code in a program with a different name (e.g. GAMEA) and then do AsmComp((prgmGAMEA,prgmGAME).

Assembly programs can be run with Asm(.

Error Conditions

Related Commands

ASMPRGM.GIF

Command Summary

This command must be the beginning of an assembly program.

Command Syntax

AsmPrgm

Menu Location

This command is only found in the catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. Scroll down to AsmPrgm and press ENTER.

Calculator Compatibility

TI-83+/84+/SE/CSE/CE

(not available on the regular TI-83)

Token Size

2 bytes

This command denotes the start of an assembly program in hexadecimal form. The command must go at the beginning of a program.

Using AsmPrgm is the only built-in way to create assembly programs on the calculator, and it's not very convenient. To use it, after AsmPrgm itself, you must type in the hexadecimal values (using the numbers 0-9, and the letters A-F) of every byte of the assembly program. Even for assembly programmers, this is a complicated process: unless you've memorized the hexadecimal value of every assembly command (which is about as easy as memorizing the hexadecimal value of every TI-Basic token) you have to look every command up in a table.

In addition, it's easy to make a typo while doing this. For this reason, it's recommended not to use AsmPrgm to write assembly programs on the calculator, but instead write assembly programs on the computer. This also lets you use emulators and debuggers and such, as opposed to crashing your calculator (possibly permanently) every time you have a bug.

Just about the only use for AsmPrgm is to enter the hex codes for simple assembly routines that can be called from Basic programs or used for some other short task. For example, the following program will allow you to type in lowercase letters (by pressing ALPHA twice, you go into lowercase letter mode):

AsmPrgmFDCB24DEC9

To use this, create a program, and enter the code above into it. Then run the program using Asm(. Voila! Lowercase letters are now enabled.

More such short programs can be found here.

TI-84+ Color Calculators

For the TI-84+ C series of calculators, AsmPrgm has been replaced by two new commands: AsmPrgm84C for the TI-84+ CSE and AsmPrgmCE for the TI-84+ CE. The commands function in the exact same manner as the original AsmPrgm command. However, it is important to note that sending assembly programs between a CSE and CE (or vice versa) may cause errors due to a difference in commands.

Many of the hex codes involving AsmPrgm also no longer function correctly on C series calculators. The updated hex codes can be found here. Please note, however, that directly entering hex codes has been disabled on the CE with OS 5.3.1; attempting to view AsmPrgmCE in the catalog will show the command crossed-out. Hex codes can be still be run from older programs.

Related Commands

See Also

ASM.GIF

Command Summary

Runs an assembly program.

Command Syntax

Asm(prgmNAME)

Menu Location

This command is only found in the catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. DOWN six times.
  3. ENTER to select Asm(.

Calculator Compatibility

TI-83+/84+/SE

(not available on the regular TI-83)

Token Size

2 bytes

The Asm( command is used for running an assembly program. Unlike TI-Basic programs, assembly programs are written in the calculator's machine code directly, which makes them more powerful in both speed and functionality. However, it also means that if they crash, they crash hard — there is no built-in error menu to protect you.

Keep in mind that many assembly programs these days are written for a shell such as Ion or MirageOS. If you're dealing with one of those programs, calling Asm( on it will do nothing; you need to get the appropriate shell and run that instead.

With the AsmPrgm and AsmComp( commands, you can create small assembly programs yourself, directly on the calculator. If you are using at TI-84+CE with OS 5.3, the Asm( is unnecessary to run such programs.

Error Conditions

  • ERR:INVALID is thrown if the program isn't an assembly program.

Related Commands

See Also

PERCENT.GIF

Command Summary

Short for dividing by 100.

Command Syntax

value%

Menu Location

This command can only be accessed through a hex editor (its hex code is 0xBB 0xDA)

Calculator Compatibility

TI-83/84+/SE, OS v1.15+

Token Size

2 bytes

The % symbol is an undocumented command on the TI-83 series calculators starting with OS version 1.15. It's useful as a shortcut for percents - it divides by 100, so it will convert numbers to percentages. For example, 50% will become 50/100 or 1/2, which is just what 50% should be.

Although this trick can save you a few bytes, it also makes your program incompatible with old OS versions — it's up to you to decide if the tradeoff is worth it.

The % symbol is not quite equivalent to the value 0.01: typing in % by itself will give you a syntax error, as expected.

Entering the % symbol

There are several assembly programs out there that can let you access the % symbol if you know what you're doing, but here is a short, self-contained way. First, create an assembly program by entering the following into the program editor:

:AsmPrgmEFF1423605C9
:BBDA

Then compile it: for example, if you entered the above into prgmX, and prgmY is free, then you can run

AsmComp(prgmX,prgmY

Then run the compiled assembly program:

Asm(prgmY

Now the compiled assembly program will become unlocked and contain the characters:

:??ˣ√B6BoxPlotsinh⁻¹(%

Most of this is garbage data and can be deleted, and the final character is the % character we wanted. (If you delete the other characters, then the % symbol can be accessed at any time by pressing [2nd][RCL] and choosing prgmY.)

Error Conditions

  • ERR:INVALID is thrown on older operating system versions.

Related Commands

EXPROFF.GIF

Command Summary

The number of the equation or plot being traced is displayed in the top right corner.

Command Syntax

ExprOff

Menu Location

Press:

  1. 2nd FORMAT to access the graph format menu
  2. Use arrows and ENTER to select ExprOff

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The ExprOff command enables a "short" form of displaying the equation or plot being traced. That is, only the number of the equation or plot will be displayed, in the top right corner of the screen. When tracing a plot, the number will be prefixed with a P to distinguish it from an equation.

Related Commands

EXPRON.GIF

Command Summary

The equation or plot being traced is displayed in long form at the top of the screen.

Command Syntax

ExprOn

Menu Location

Press:

  1. 2nd FORMAT to access the graph format menu
  2. Use arrows and ENTER to select ExprOn

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The ExprOn command enables a "long" form of displaying the equation or plot being traced.

In this mode, when tracing an equation, the equation's name and its formula are written in small font at the top of the screen. For example, when tracing Y1 which is equal to 2X, "Y1=2X" will be displayed.

When tracing a plot, the plot number is written, followed by the list or lists that it describes. For example, when tracing Plot1, which is a scatter plot of ∟X and ∟Y, "P1:X,Y" will be displayed.

Related Commands

COORDON.GIF

Command Summary

Turns on the cursor coordinate display on the graph screen.

Command Syntax

CoordOn

Menu Location

Press:

  1. 2nd FORMAT to access the graph format menu
  2. Use arrows and ENTER to select CoordOn

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

When moving a cursor on a screen, it's possible for the calculator to display the coordinates of the current point (either polar or rectangular coordinates, depending on which of RectGC or PolarGC is set). The CoordOn command turns on this option (to disable it, use the CoordOff command).

The coordinates are displayed in practically every situation when you're moving a cursor on the graph screen, even including the Trace, Input or Select( commands in a program. The interactive mode of Text( and the Pen tool are the exceptions — this is because these two situations involve a pixel coordinate, and not a point.

Related Commands

COORDOFF.GIF

Command Summary

Turns off the cursor coordinate display on the graph screen.

Command Syntax

CoordOff

Menu Location

Press:

  1. 2nd FORMAT to access the graph format menu
  2. Use arrows and ENTER to select CoordOff

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

When moving a cursor on a screen, it's possible for the calculator to display the coordinates of the current point (either polar or rectangular coordinates, depending on which of RectGC or PolarGC is set). The CoordOff command turns off this option.

To turn it on, use the CoordOn command.

Related Commands

POLARGC.GIF

Command Summary

Sets the calculator to display point coordinates using polar coordinates.

Command Syntax

PolarGC

Menu Location

Press:

  1. 2nd FORMAT to access the graph format screen
  2. Use arrows and ENTER to select PolarGC.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The PolarGC ("Polar Grid Coordinates") command (like its opposite, the RectGC) command, affects how the coordinates of a point on the graph screen are displayed. When PolarGC is enabled, the coordinates of a point are displayed as (R,θ).

The polar coordinates of a point can be interpreted as the distance R it is away from the origin (0,0), and the direction θ. θ is the angle that a ray to the point would make with the positive X-axis (so polar coordinates are affected by Degree/Radian mode). An angle of 0 means the point is to the left of the origin; an angle of 90° (π/2 radians) means it's up from the origin, and so on. So, for example, the point with R=2 and θ=270° (3π/2 radians) would be two units down from the origin.

Of course, coordinates are only displayed with the CoordOn setting; however, with CoordOff, RectGC and PolarGC are still useful, because in a variety of cases, the coordinates of a point are also stored to variables. PolarGC doesn't change the fact that they're stored to X and Y, as with RectGC; however, with PolarGC, they are also stored to R and θ.

Although the PolarGC command naturally goes with Polar graphing mode, the two settings are independent; you can use both PolarGC and RectGC with any graphing mode.

Advanced

The following situations involve storing coordinates of a point to variables:

  • Graphing an equation
  • Tracing an equation or plot
  • Moving the cursor on the graph screen
  • Using the interactive mode of one of the 2nd DRAW commands
  • Using one of DrawF, DrawInv, or Tangent(
  • Anything in the 2nd CALC menu.

Naturally, any command like Input or Select( which involves the above, will also store coordinates of a point.

Related Commands

RECTGC.GIF

Command Summary

Sets the calculator to display point coordinates using rectangular (Cartesian) coordinates.

Command Syntax

RectGC

Menu Location

Press:

  1. 2nd FORMAT to access the graph format screen
  2. Use arrows and ENTER to select RectGC.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The RectGC ("Rectangular Grid Coordinates") command (like its opposite, the PolarGC) command, affects how the coordinates of a point on the graph screen are displayed. When RectGC is enabled, the coordinates of a point are displayed as (X,Y).

The X and Y coordinates of a point are interpreted as the horizontal and vertical distance from the origin (the point (0,0)) Up and right are positive directions, while down and left are negative. For example, the point (1,-2) — that is, the point with x-coordinate 1 and y-coordinate -2 — is one horizontal unit right and two horizontal units down from (0,0).

Of course, coordinates are only displayed with the CoordOn setting; however, with CoordOff, RectGC and PolarGC are still useful, because in a variety of cases, the coordinates of a point are also stored to variables. With RectGC enabled, they are stored to X and Y.

Advanced

The following situations involve storing coordinates of a point to variables:

  • Graphing an equation
  • Tracing an equation or plot
  • Moving the cursor on the graph screen
  • Using the interactive mode of one of the 2nd DRAW commands
  • Using one of DrawF, DrawInv, or Tangent(
  • Anything in the 2nd CALC menu.

Naturally, any command like Input or Select( which involves the above, will also store coordinates of a point.

Related Commands

GRIDON.GIF

Command Summary

Enables the grid on the graph screen.

Command Syntax

GridOn

Menu Location

Press:

  1. 2nd FORMAT to access the graph format menu.
  2. Use arrows and ENTER to select GridOn.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The GridOn command enables a grid on the graph screen (you can disable it again with the GridOff command). How fine or coarse the grid is depends on the Xscl and Yscl variables. Drawing the grid just involves plotting points all the points of the form (A*Xscl, B*Yscl) that are in the graphing window. The grid is often used in games such as Dots & Boxes, Tic-Tac-Toe, and 2D puzzles.

On the TI-84+CSE and TI-84+CE, an additional argument may be used to set the color of the grid:

:GridOn GRAY

Like other drawing commands, the color may be replaced by its numerical value (ranging from 10 to 24).

Advanced Uses

GridOn can be used to shade the entire screen if Xscl and Yscl are small enough that the points on the grid are one pixel apart:

:ΔX→Xscl
:ΔY→Yscl
:GridOn

This is one of the shortest ways to shade the screen, although Shade( can be used for a (usually) even shorter way. However, using GridOn is also very slow: the fastest way involves the Horizontal or the Vertical commands in a For( loop (or the BackgroundOn command for color calculators).

Related Commands

GRIDOFF.GIF

Command Summary

Disables the grid on the graph screen.

Command Syntax

GridOff

Menu Location

Press:

  1. 2nd FORMAT to access the graph format menu.
  2. Use arrows and ENTER to select GridOff.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The GridOff command disables the grid on the graph screen. This is the default setting. Use GridOn to enable the grid.

Related Commands

Note: The Piecewise Expressions page more clearly spells out the concepts discussed within this page, so please link to that page instead.

Boolean logic is the way that the calculator expresses logical statements. A statement can have either one of two values, true or false, and can be as simple or complex as you want. For example, if we were evaluating a proposition from a sentence, such as "It is cold in Minnesota…", this proposition can only be true or false at any one time — in this case, it is definitely true :D

While we humans are able to think about a proposition and evaluate its truth-hood rationally, the calculator has its own built-in system based strictly on math for determining whether a logic statement is true or false. In addition, the calculator uses a value of zero (0) to signify false, and one (1) or any other non-zero number (including negative, decimal, and even complex) to signify true.

The primary places where you will see Boolean logic used are in conditionals and loops, although its application and impact can be felt almost everywhere. A typical conditional in TI-Basic looks something like this:

:If A=5
:B+4→B

When the calculator evaluates the A=5 statement, it will get back either a value of zero or one. If it gets a one, that means the A variable had a value of five at the time, and it will subsequently go ahead and execute the statement immediately following on the next line (i.e., B+4→B). However, the next statement will be completely skipped over if a zero is returned.

Although the statement in the previous example is already pretty simple, you can in fact go even simpler, and just use 1 or 0 as the statement. Because both of them are absolutes, meaning their value never changes, the statement will essentially be executed or completely skipped over each time indefinitely — there is no need to do any evaluating because there is nothing to evaluate.

In terms of practical use, you could use a While 1 loop as the main program loop that encompasses the entire program. Because a While loop has no built-in capability to break out of the loop, it would not end until you manually exited it (by pressing the ON key).

:While 1
:Disp "Hello World
:End

Similarly, you can use a While 0 loop (or If 0 conditional) for making comments in your programs, as well as creating a special kind of subprogram which exists entirely inside a program. Both of these applications are somewhat advanced, but they nonetheless still rely on Boolean logic to work.

Boolean Conditionals

The most useful, and common, application of Boolean logic is what is known as Boolean conditionals. Boolean conditionals work best when just manipulating one variable, and the way they work is by putting the condition statement inside parentheses, and then placing it right next to the value that you are manipulating the variable by. For example, here is what the original conditional would look like:

:B+4(A=5→B

Because the calculator uses math for determining the value of a statement, it will first evaluate the statement inside the parentheses (which is our A=5 statement), and return 1 or 0, respectively. The calculator then multiplies that value by the value you are adding to the variable (in this case, 4), and stores the result to the variable. A helpful way to look at it is by replacing the statement with the literal 1 and 0 numbers:

:B+4(1)→B

As you can see, the calculator will multiply 4 times 1, and then store that to B (so B will now have a value that is increased by four). If you replace the 1 with 0, the calculator will still multiply and store a value to B, but it will instead turn out to be 0 (because anything multiplied by zero equals zero; it's a basic law of algebra), so the B variable will still have its original value.

Of course, your Boolean conditionals don't have to be that simple — you can have multiple conditions with almost any combination of commands, functions, and operators, and the calculator will evaluate them like it would anything else. One of the most common Boolean conditionals that you will see involves using the arrow keys to move a character around the screen:

:getKey→K
:Y-(Ans=25)+(Ans=34→Y
:X-(K=24)+(K=26→X

In this particular example, there are two conditionals used because you can move in the Y direction (which is represented by the first conditional and uses the up and down arrow keys) and the X direction (which is represented by the second conditional and uses the left and right arrow keys), so you need to keep track of two separate variables, and likewise update each variable independently of the other.

See Also

DEPENDAUTO.GIF

Command Summary

Enables automatic calculations in the table.

Command Syntax

DependAuto

Menu Location

Press:

  1. 2nd TBLSET to access the table settings menu.
  2. Use arrows and ENTER to select Auto from the Depend: line.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

When the DependAuto setting (opposed to the DependAsk setting) is turned on, values in the table are automatically calculated. With IndpntAuto, that means the table is automatically filled out completely; with IndpntAsk, that means that as soon as you enter a value for the independent variable, all the values of the dependent variables are calculated. This is usually the setting you want to use.

Related Commands

DEPENDASK.GIF

Command Summary

Disables automatic calculations in the table.

Command Syntax

DependAsk

Menu Location

Press:

  1. 2nd TBLSET to access the table settings menu.
  2. Use arrows and ENTER to select Ask from the Depend: line.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

When the DependAsk setting (opposed to the DependAuto setting) is turned on, values in the table are not automatically calculated. To calculate the value of an equation, you have to select the column corresponding to that equation in the row corresponding to the value at which to calculate it, and press ENTER. For example, to calculate Y1 at X=0, select the X=0 column, scroll right to Y1, and press ENTER.

The DependAsk setting might be useful when dealing with a difficult-to-calculate function, for which you wouldn't want to have to calculate values that aren't really necessary.

Related Commands

INDPNTASK.GIF

Command Summary

Doesn't automatically fill in table values for the independent variable.

Command Syntax

IndpntAsk

Menu Location

Press:

  1. 2nd TBLSET to access the table settings menu.
  2. Use arrows and ENTER to select Ask in the Indpnt: line.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

With the IndpntAsk setting, the independent variable (X, T, θ, or n depending on graphing mode) will not be calculated automatically in the table. Instead, when looking at the table, you must select an entry in the independent variable column, press ENTER, and enter a value. The values entered will also be stored to the TblInput list.

(To access the table, press [2ND][TABLE], or use the DispTable command in a program)

The alternative, IndpntAuto, fills in several values starting at TblStart and increasing by ΔTbl, and makes the table scrollable (up and down).

Related Commands

INDPNTAUTO.GIF

Command Summary

Automatically fills in the table values for the independent variable.

Command Syntax

IndpntAuto

Menu Location

Press:

  1. 2nd TBLSET to access the table settings.
  2. Use arrows to select Auto in the Indpnt line to select IndpntAuto.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The IndpntAuto setting sets the independent variable (X, T, θ, or n depending on graphing mode) to be filled in automatically in the table (which is accessible by pressing 2nd TABLE, or from a program with the DispTable command).

The values which will be filled in start at the value TblStart and increment by ΔTbl(which can be negative, but not 0). They will also be stored in the list TblInput. All these variables can be accessed through the VARS|6:Table… menu; TblStart and ΔTbl can also be edited in the [2ND][TBLSET] menu.

The other possibility for this setting is IndpntAsk - if that setting is turned on, you must scroll to the corresponding row in the independent variable column, and enter a value.

Error Conditions

Related Commands

DISPGRAPH.GIF

Command Summary

Displays the graph screen.

Command Syntax

DispGraph

Menu Location

While editing a program, press:

  1. PRGM to access the program menu.
  2. RIGHT to access the I/O submenu.
  3. 4 to select DispGraph, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The DispGraph command displays the graph screen, along with everything drawn or graphed on it.

In many cases, this doesn't need to be done explicitly: commands from the 2nd DRAW menu, as well as many other graph screen commands, will display the graph screen automatically when they are used. Mainly, it's used for displaying the graphs of equations or plots in a program — you would define the variable in question, then use DispGraph to graph it. For example:

:"sin(X)"→Y1
:DispGraph

Advanced Uses

DispGraph can also be used to update the graph screen, even if it's already being displayed. For example, changing the value of a plot or equation variable doesn't update the graph immediately. Consider this program:

:0→I
:"Isin(X)"→Y1
:DispGraph
:For(I,1,10)
:End

At first, it graphs the equation Y=Isin(X) with I=0. After this, I is cycled from 1 to 10. However, though the parameter I changes, the graph screen isn't updated, and only the initial graph of Y=0sin(X) and final graph of Y=10sin(X) are displayed. If, on the other hand, we change the program:

:0→I
:"Isin(X)"→Y1
:DispGraph
:For(I,1,10)
:DispGraph
:End

Now the DispGraph inside the loop ensures that the graph screen is updated every time, and the program will correctly display all eleven graphs.

Error Conditions

  • ERR:INVALID occurs if this statement is used outside a program.

Related Commands

CLEARENTRIES.GIF

Command Summary

Clears the history of commands previously entered on the homescreen.

Command Syntax

Clear Entries

Menu Location

Press:

  1. 2nd MEM to access the memory menu.
  2. 3 to select Clear Entries, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

Normally, by pressing 2nd ENTER repeatedly, you can cycle through some of the recent entries on the home screen. With the Clear Entries command, this history is cleared (only Clear Entries remains in the history).

This can be used to free some memory, although it's recommended not to do this in a program (because clearing things without asking first isn't nice). Aside from that, maybe the only reason to use Clear Entries is to protect your privacy — although someone looking at your entries will know you cleared something, so it's not that effective.

Related Commands

GARBAGECOLLECT.GIF

Command Summary

Clears up 'garbage' that comes from unarchiving or deleting archived files.

Command Syntax

GarbageCollect

Menu Location

This command can only be found in the catalog. Press:

  1. 2nd CATALOG to access the command catalog
  2. G to skip to commands starting with G
  3. ENTER to select GarbageCollect

Calculator Compatibility

TI-83+/84+/SE
(not available on the regular TI-83)

Token Size

2 bytes

A bit of a preamble: unlike RAM, which is the easy-to-access memory, Flash ROM (the archive), used for long-term storage on the 83+ and higher, can't be written to easily. Skipping over technicalities, what's written in the archive once is semi-permanent, and can't be written to again unless an entire 64KB sector of memory is erased.

As a result, when you delete a variable from archive, the calculator doesn't delete it immediately (there may be other, good variables in the same block that would get erased as well), it just marks it as deleted. Similarly, when you unarchive a variable, its data is copied to RAM and the original is marked as deleted.

Naturally, this can't be done forever: sooner or later you'll run out of space in the archive because all of it is taken up by these "garbage variables". At this point, the calculator does something known as "garbage collecting". It copies the actually-used variables in each sector to a backup sector (set aside just for this purpose), then erases it; the process is repeated for the other sectors. Additionally, the variables are rearranged so that they aren't spread out all over the place; this makes it more likely that a spot will be found for large variables.

While "garbage collecting" will be done automatically when it's absolutely necessary, this may be a time-consuming process at that stage. Instead, you can call the GarbageCollect command yourself periodically (how often depends on your calculator habits, but generally once a month or so could work) to keep the Flash ROM in a semi-neat state, and then it will be a fairly quick process.

During garbage collection, a menu will appear that asks you "Garbage Collect?", giving you the options No and Yes. If you didn't select the GarbageCollect command yourself, it's highly recommended to select Yes. If you did select it, you probably want to garbage collect, so you should also select Yes. At that point, the message "Garbage collecting…" will be displayed for some time, and then the process will end.

Advanced Uses

To avoid garbage collecting often, reduce the amount of times you archive and unarchive variables. There's also the consideration that too many writes to the Flash ROM (which are directly related to the number of GarbageCollects you do) can, in theory, wear it out. This probably would take much longer than anyone's used a TI-83+ calculator so far, though, and in all probability you don't really have to worry about this.

Related Commands

LABELOFF.GIF

Command Summary

Disables labels on the X and Y coordinate axes.

Command Syntax

LabelOff

Menu Location

Press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows and ENTER to select LabelOff.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The LabelOff setting disables labels on the X and Y coordinate axes. This is unnecessary if you've disabled the axes themselves, since the labels are only displayed when the axes are. To enable the labels, use the reverse setting LabelOn.

Related Commands

LABELON.GIF

Command Summary

Puts labels on the X and Y coordinate axes.

Command Syntax

LabelOn

Menu Location

Press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows and ENTER to select LabelOn.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The LabelOn setting enables labels on the X and Y coordinate axes. If both LabelOnand AxesOn are set, the axes will be displayed with an X next to the X (horizontal) axis, and a Y next to the Y (vertical) axis. To disable these labels, use the LabelOff setting.

LabelOn and LabelOff have no effect if the coordinate axes aren't displayed; there's nothing to label.

A somewhat quirky behavior of the X and Y labels is that they aren't saved by StorePic. If you save a picture of the graph screen, it records every detail of the way it looks, including equations, drawn elements, axes, grid, everything — but not the labels.

One final comment: okay, so by the way the command works we know it was once intended to label the axes. However, the command doesn't actually check where the axes are. It puts an "x" slightly above the bottom right corner, and a "y" slightly below the top left. Most of the time, including the default graphing window, that doesn't help you to distinguish the axes in the slightest. And in split-screen mode, as shown in the screenshot, they both seem to label the x-axis. Weird.

Related Commands

Routine Summary

Simulates Langton's ant on the screen.

Inputs

None

Outputs

None

Variables Used

A, B, C

Calculator Compatibility

TI-83/84/+/SE

Author

Arcane Wizard

URL: United TI

Download

langtonant.zip

:ClrDraw
:31→A:47→B
:randInt(1,4→C
:Repeat getKey
:C-1+2pxl-Test(A,B
:Ans+4((Ans<1)-(Ans>4→C
:Pxl-Change(A,B
:B+(Ans=2)-(Ans=4→B
:A+(C=3)-(C=1→A
:End

Langton's ant is a simulation of the movement of an ant, with some simple rules governing it: the ant can move in any of the four cardinal directions, but whenever it goes over one of the previous spots that it was at, it will change direction 90°. Although the ant movement appears chaotic, given enough time it actually ends up being a pattern.

In our routine, the ant is going to be a simple pixel. Before we can display the ant on the screen, however, we need to clear it and initialize its starting position. (47,31) was chosen because it is the exact center of the screen, which should provide the ant with ample room to move around.

We then randomly select a starting direction for the ant to go — 1 for down, 2 for right, 3 for up, and 4 for left. Once we have a direction selected, we display the ant and it will start moving around. The ant will keep moving around indefinitely until you press a key, although you could limit it to a set number of moves by replacing the Repeat loop with a For( loop.

DRAWINV.GIF

Command Summary

Draws the inverse of a curve in terms of X.

Command Syntax

DrawInv curve

Menu Location

Press:

  1. 2nd DRAW to access the draw menu.
  2. 8 to select DrawInv, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The DrawInv command draws the inverse of a curve in terms of X. Its single argument is an expression in terms of X.

For example, DrawInv X² will draw the inverse of the equation Y=X2. The inverse reverses the variables X and Y, so that the curve X=Y2 will be graphed. In this case, the inverse of the function has a simple form: Y=√(X) and Y=-√(X); most functions, however, do not have an inverse expressible as Y= equation, making this command particularly useful.

You can also think of this as graphing the expression but with X representing the vertical direction, and Y representing the horizontal.

DrawInv requires the calculator to be in Func mode, and is affected by the Connected/Dot setting.

Advanced Uses

DrawInv will update X and Y for each coordinate drawn (like Tangent( and DrawF), and exit with the last coordinate still stored.

When evaluating the expression using DrawInv, the calculator will ignore the following errors: ERR:DATA TYPE, ERR:DIVIDE BY 0, ERR:DOMAIN, ERR:INCREMENT, ERR:NONREAL ANS, ERR:OVERFLOW, and ERR:SINGULAR MAT. If one of these errors occurs, the data point will be omitted.

For this reason, DrawInv can sometimes behave in an unexpected fashion: for example, it doesn't throw an error for list or matrix expressions (it won't graph anything, either).

Error Conditions

  • ERR:MODE is thrown if the calculator is not in Func mode when using DrawInv.

Related Commands

AXESON.GIF

Command Summary

Enables the X- and Y- axes on the graph screen.

Command Syntax

AxesOn

Menu Location

Press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows and ENTER to select AxesOn.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The AxesOn command enables the X and Y axes on the graph screen, so that they are drawn. They can be disabled with the AxesOff command.

(the y=x line that is drawn when both Seq and Web modes are enabled is also controlled by this command)

Related Commands

AXESOFF.GIF

Command Summary

Disables the X- and Y- axes on the graph screen.

Command Syntax

AxesOff

Menu Location

Press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows and ENTER to select AxesOff.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The AxesOff command disables the X and Y axes on the graph screen, so that they aren't drawn. They can be enabled again with the AxesOn command.

(the y=x line that is drawn when both Seq and Web modes are enabled is also controlled by this command)

Generally, the AxesOff command should be used at the beginning of the program to disable the axes if the program is going to use the graph screen, since the axes get in the way. However, you should consider using StoreGDB and RecallGDB to save this setting if that's the case.

Related Commands

FNOFF.GIF

Command Summary

Turns off equations in the Y= editor (all of them, or only the ones specified)

Command Syntax

FnOff [integer] [,integer]

Menu Location

Press:

  1. VARS to access the variables menu.
  2. RIGHT to access the Y-VARS submenu.
  3. 4 to select On/Off…, or use arrows and ENTER.
  4. 2 to select FnOff, or use arrows and enter.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The FnOff command is used to turn off equations in the current graphing mode. When you turn off an equation, it's still defined, but isn't graphed; you can reverse this with the FnOn command. To turn functions on and off manually, put your cursor over the = symbol in the equation editor, and press enter.

When FnOff is used by itself, it will turn off all defined equations in the current graphing mode. You can also specify which equations to turn off, by writing their numbers after FnOff: for example, FnOff 1 will turn off the first equation, and FnOff 2,3,4,5 will off turn the second, third, fourth, and fifth. The numbers you give FnOff have to be valid equation numbers in the graphing mode. When turning equations on and off in sequence mode, use 1 for u, 2 for v, and 3 for w.

The most common use for FnOn and FnOff is to disable functions when running a program, so that they won't interfere with what you're doing on the graph screen, then enable them again when you're done.

Error Conditions

  • ERR:DOMAIN is thrown if an equation number isn't valid in the current graphing mode, or at all.

Related Commands

FNON.GIF

Command Summary

Turns on equations in the Y= editor (all of them, or only the ones specified)

Command Syntax

FnOn numbers//

Menu Location

Press:

  1. VARS to access the variables menu.
  2. RIGHT to access the Y-VARS submenu.
  3. 4 to select On/Off…, or use arrows and ENTER.
  4. ENTER to select FnOn.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The FnOn command is used to turn on equations in the current graphing mode. When you define an equation, it's turned on by default, but the FnOff command can turn an equation off (in which case, it's still defined, but isn't graphed). To turn functions on and off manually, put your cursor over the = symbol in the equation editor, and press enter.

When FnOn is used by itself, it will turn on all defined equations in the current graphing mode. You can also specify which equations to turn on, by writing their numbers after FnOn: for example, FnOn 1 will turn off the first equation, and FnOn 2,3,4,5 will turn the second, third, fourth, and fifth. The numbers you give FnOn have to be valid equation numbers in the graphing mode. When turning equations on and off in sequence mode, use 1 for u, 2 for v, and 3 for w.

The most common use for FnOn and FnOff is to disable functions when running a program, so that they won't interfere with what you're doing on the graph screen, then enable them again when you're done.

Error Conditions

  • ERR:DOMAIN is thrown if an equation number isn't valid in the current graphing mode, or at all.

Related Commands

When contributing a tip or trick, please follow these guidelines:

  1. A tip/trick about using a variable should only be included if it is undocumented or not well-known.
  2. A tip/trick should have some practical application as part of a program, and not just be something trivial.
  3. A tip/trick about making a program more efficient generally belongs on the optimization page.
  4. A tip/trick should be thoroughly explained and tested to make sure others can use it correctly.

General Tips

Checking for Whole Number

The fastest way to check for a whole number is:

:not(fPart(X

Using DelVar

When using the DelVar command, you don't need to use colons (:) between the DelVars:

:Delvar ADelvar Str1...

This also holds when you are dealing with a completely different command, so

:DelVar AClrHome

is perfectly legal.

Know When to Use Variables

Many times you will have to use a number repeatedly in a program. To save memory you can assign that number to a variable at the beginning of your program and then just call that variable whenever you need it. This also works for strings that are used a lot.

Why Variables Get Messed Up

There are several things that can cause variables to get messed up:

  • The Equation Solver updates any given letter variable that is solved for.
  • Function graphing, and the tracing thereof, causes X and Y to be updated.
  • Parametric graphing, and the tracing thereof, causes X, Y, and T to be updated.
  • Polar graphing, and the tracing thereof, causes X, Y, R, and θ to be updated.
  • Sequence graphing, and the tracing thereof, causes X, Y, and n to be updated.
  • Generally, moving the cursor on the graph screen updates X and Y.
  • All the above update R and θ as well if in PolarGC mode.
  • Tangent, DrawF, and DrawInv update X and Y for each coordinate drawn.
  • All Shade( functions update X and Y for each coordinate drawn.
  • Y is set to zero per each refresh of the graph screen. (The only reason I can think of is that Y is involved in the calculating of the regions.)
  • Generating a list through sequencing does not update letter variables (but will create them if they didn't exist)

Extra Variables

Sometimes when doing a program you might run out of variables to use. If that happens there are many different places you can go to for more variables. Some are:

  • Create lists or matrices and just use/manipulate them
  • Extra N—Open the catalog and press LOG and ENTER
  • Window variables—Hit VARS and then ENTER
  • Statistic variables—Hit VARS, 5, and scroll through the menus of variables
  • Finance variables—Hit APPS and then go into the Finance application

(Note: You can also use most of them as characters.)

List Tips

Use Custom Lists before Built-In Lists

Avoid using lists other than L1, L2,…, L6. You should only use custom lists when you need to save something.

Check if Elements are the Same

The quickest way to check if all the elements of L1 are the same is max(Δlist(L1.

Separate a List

You can use seq(L1(A),A,C,D→L2 to separate a list into two or more lists, where C is the start and D is the stop.

Favor cumSum(binomcdf( over seq(

cumSum(binomcdf(X,0 is the same as seq(I,I,1,X and is smaller and faster. See here for more information.

Angle Values in List

If you use the tangent, sine, or cosine function in programs you might notice they aren’t that fast. A better way to do it is to store the values in a list and then recall them from the list.

Store to one List Element Higher than Exists

You can store to one list element higher than exists. This even applies if the list does not exist, in which case the list would be created and the first element would be where the value is stored.

:3→dim(L1
:Input A
:A→L1(4

(Note: This will create a fourth element in list 1, and then store A in the fourth element.)

Create a List without the L in Front

When you store to a custom list, usually you need the little “L” in front. However, this is not true. If you just have a letter or a number that is being stored to, it will actually store the list data to a list with the letter or number’s name.

:{1,2→LA
can be
:{1,2→A

Shuffle a List

The smallest and (almost) fastest way to shuffle a list (for instance, a deck of cards) is:

:seq(X,X,1,52→L1
:rand(52→L2
:SortA(L2,L1

This technique can, of course, be extended to lists of other lengths.

Chop Off First Element of a List

You can chop off the first element of a list by using the ∆List( and cumSum( commands together, since they are essentially exact opposites. In this example, the first element of L1 is chopped off and the list is stored back to L1:

:∆List(cumSum(L1→L1

User-Friendly Lists

I'm sure others like me want to be able to type in a list without the brackets, separating the elements with only commas. Here's how:

:Input Str1
:expr("{"+Str1→L1

Load a User-Named List

This will load any list the user names:

:Repeat 5≥length(Str1
:Input "Name of List:",Str1
:End
:expr("L"+Str1→L1

Matrix Tips

Initializing Matrices

In games where you store maps with all the same values in matrices, you need to initialize the matrices in order to use them. There are three different ways that you can do this.

The first way is to set the dimensions of a matrix and then use the Fill( command:

:{8,8→dim([A]
:Fill(0,[A]

The second way you can initialize the matrix is to actually delete it before using it, and then set its dimensions to the desired row and width. This initialization method only works when you want all the matrix elements to have a value of zero.

:DelVar [A]{8,8→dim([A]

The last way you can initialize the matrix is to use the identity( command. The identity( command is used to create an identity matrix based on the matrix that it's given, which must be a square, n-by-n matrix. Because of the identity( command, this initialization method only works when you have a square matrix and you want all the matrix elements to have a value of zero.

:0identity(8→[A]

String Tips

Skip String►Equ( Command

If you want to put a string into one of the function variables (Y0-Y9) you don’t need to use the String►Equ( command. Instead, you can just simply store the string into the function variable.

:String►Equ(Str1,Y1
can be
:Str1→Y1

Get → and " in a String

Follow these steps to get the or " symbols in a string:

  1. Type them on the home screen and press [ENTER]
  2. Select 2:Quit when the ERR:SYNTAX comes up.
  3. Press [Y=] to go to the equation editor.
  4. Press [2nd] [ENTRY] to recall the symbols to Y1
  5. Now, use Equ►String(Y1,Str1) to store the symbols to a string.

Use the expr( Command

One of the most unknown and unused commands is expr(. What this command does is allow you to store an expression to a string (includes graph equations) and then execute the string. Since you may use graph equations, you have 28 "extra" strings to use for text and data storage. But if you use graph equations to store data in a graphics-based program, remember to turn the functions off with FnOff.

:Input “Formula:”,Str1
:Disp expr(Str1

Converting a String to List

The fastest way to convert a string that contains only alphanumeric characters and spaces to a list is:

:seq(inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",sub(Str1,A,1)),A,1,length(Str1→L1

Copy & Paste Function

If you store frequently used code to a string, you can recall the string into a program as a sort of "copy-and-paste" function. However you have to go through menus to get to the string, not to mention delete the quotes. So store your three most frequently used pieces of string into those variables, u, v, and w. Recalling these don't generate quotes, and it's faster than getting it from a string within the menus. See self-modifying code for more information.

Ans Tips

If you want to speed up your program while doing calculations, you can use the Ans variable. To use Ans, put the calculation in a line all by itself, then it will automatically be stored into Ans saving the need for storing the calculation into a variable. (NOTE: You should only use Ans if it involves changing just one variable.)

:If 8>C
:Output(4,2,"Higher
:If 8<C
:Output(4,2,"Lower
can be
:"Higher
:If 8<C
:"Lower
:Output(4,2,Ans

Whenever you are using the pxl-Test( command and speed is a priority, you should put the command on its own line and test for Ans:

:pxl-Test(0,0
:If Ans
is faster than
:If pxl-Test(0,0

When you are using a For( loop, you can use the following if you want to store something in A without messing up Ans:

:For(A,16,0,-1
:End

Productivity is all about using your TI calculator as efficiently and effectively as possible. There are several things you can do to improve your productivity when you are writing TI-Basic programs:

  • Keyboard Shortcuts — In the Program editor, if you press alpha followed by up or down, you will scroll a whole page of program code. In addition, 2nd right will take you to the end of your current line, and 2nd left will take you to the beginning of that line.
  • Backup Often — You never know when your calculator might crash, and you would be extremely upset if you lost all of your new work on your program that you had been working on. If you only have one program, backing up just consists of creating a new program, and recalling the program code into that program. However, if your program uses several programs and other variables, you should group it instead.
  • Archive Programs — When you are not using a program, you should archive it so that it won't get erased accidentally in case of a RAM clear. This also applies to important program data, such as a highscore list. Alternatively, you can also group the program and program data together so you have both in one file. Grouping also saves more RAM than archiving the programs separately.
  • Know The Commands — There are lots of commands on the calculator that people never bother using, mainly because they don't know about them. Before trying to create your own program to do something, check to see if the calculator doesn't already provide a command or function that does it, because the built-in commands are almost always faster and smaller.
  • Edit On The Computer — The TI-Graph Link program that TI provides allows you to edit programs on the computer. In addition to faster scrolling and making program structure easier to visualize, the Graph Link also features the ability to type lowercase text and lock a program so it can't be edited on the calculator.
  • Use CtlgHelpCtlgHelp is an Assembly application that is rather large (it is 32KB), but is a very helpful reference when trying to remember the syntax for using a command. After you have installed it, you just have to go to the Catalog menu and press the + key to see the help for that command. It can also be used in other menus, such as the MATH, LIST, and PRGM menus.
  • Write Comments — Whenever you write a complicated piece of code, you should put a comment in the code explaining what it does, and if appropriate, how it does it. If you ever need to come back to the code, you will now be able to quickly ascertain everything you need to know about the code. Comments are also useful when you don't have the time to implement something, and you want to remind yourself with a quick "To Do".
  • Reuse Code — In many large programs, there are several pieces of code that get reused multiple times. Rather than writing the code over and over again, you can simply store it in its own program and have the main program call it as a subprogram. Because the subprogram is insignificant by itself, you should start its name with a Z or theta so that it appears at the bottom of the program list.
  • Coding Style — When writing a program, you should follow code conventions so that it is easy to read and understand. Although each programmer has their own preferences in regards to programming code, there are some general guidelines that most people follow, which help to provide continuity across the programming community:
    • Line up corresponding commands and statements vertically.
    • Don't go through silly contortions to use a loop, when Goto/Lbl branching would be more practical.
    • Use mnemonic label names. For example, Lbl UP would be an appropriate choice for code that moves the screen up.
    • Before using custom list variables, you should use up the built-in variables.
    • If you have a really complex expression, you should add some parentheses to make it easier to read.
    • Be consistent throughout all your code. If you do one thing in one program, you should do it the same way in another program.

Routine Summary

Converts temperature to Fahrenheit, Celsius, or Kelvin.

Inputs

A - the starting temperature value

Outputs

None

Variables Used

A, B, C

Calculator Compatibility

TI-83/84/+/SE

Author

Weregoose

URL: United TI

Download

temperatureconversion.zip

:Input A:0
:Menu("  Convert From  ","F",0,"C",1,"K",2
:Lbl 2:Ans+1
:Lbl 1:Ans+1
:Lbl 0:Ans→B
:For(C,0,2
:A-273.15(2B>C+2
:If Bnot(C
:1.8Ans+32
:If Cnot(B
:5/9(Ans-32
:Disp sub("FCK",C+1,1),Ans+273.15(B+2<2C
:End

With the temperature value stored in A, we ask the user to select which temperature format they want to convert it to — Fahrenheit, Celsius, or Kelvin — and then initialize the B variable to the appropriate value that matches up with the format associated with it (K is 2, C is 1, and F is 0).

We then use a For( loop to display what the respective temperature value would be in the other temperature formats, based on the respective temperature conversion formulas:

Fahrenheit Celsius Kelvin
Fahrenheit (9C/5)+32 9(K-273.15)/5+32
Celsius 5(F-32)/9 K-273.15
Kelvin 5(F-32)/9+273.15 C+273.15

One thing you will probably notice is that the formulas aren't exactly the same in the code. The reason is because the code is designed to be optimized, and rather than displaying each temperature conversion by itself, you can simply add the respective formulas as modifiers and display all of the temperature conversions together.

DBD.GIF

Command Summary

Calculates the number of days between two days.

Command Syntax

dbd(date1, date2)

Date format — one of:

  • DDMM.YY
  • MM.DDYY

Menu Location

On the TI-83, press:

  1. 2nd FINANCE to access the finance menu.
  2. ALPHA D to select dbd(, or use arrows and ENTER.

On the TI-83+ or higher, press:

  1. APPS to access the applications menu.
  2. ENTER to select Finance…
  3. ALPHA D to select dbd(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The dbd( command calculates the number of days between two dates. Each date is encoded as a single number in one of two formats (two formats can be mixed in the same command):

  • day, month, year — DDMM.YY (e.g. April 26, 1989 would be 2604.89)
  • month, day, year — MM.DDYY (e.g. April 26, 1989 would be 04.2689 or just 4.2689)

Because this is just a number like any other, leading zeroes and trailing zeroes after the decimal can be dropped. For example, January 1, 2000 does not have to be formatted as 0101.00 but can be simply 101.

Since there are only two digits for the year, obviously only a century's worth of dates can be handled. The calculator assumes this range to be from January 1, 1950 to December 31, 2049.

If the second date comes before the first, dbd( will return a negative number of days, so the range of possible results is from -36524 to 36524.

Finally, dbd( will also work for list inputs in the usual manner: a single date will be compared against every date in a list, and two lists of dates will be paired up.

dbd(612.07,2512.07
    19
dbd(1.0207,1.0107
    -1
dbd(1.0107,{2.0107,3.0107,4.0107})
    {31 59 90}

Advanced Uses

The dbd( command can be used to calculate the day of week without using the dayOfWk( command, which is only available on the TI-84+ or higher.

Error Conditions

  • ERR:DOMAIN is thrown if a date is improperly formatted.

Related Commands

See Also

FHS.gif

Routine Summary

Fakes the home screen.

Inputs

Str1,A,(B)

Outputs

none

Variables Used

Str1,A

Calculator Compatibility

TI-83/84/+/SE

Author

Adm. Wiggin

URL: United TI

Download

fakehomescreen.zip

:Repeat 0
:Input "",Str1
:Disp randInt(1,E3
:End

This routine allows you to mess with people who aren't very knowledgeable about the calculator, and don't know how to exit out of an infinite loop. The routine is very simple in that it fakes the home screen, giving the user the appearance that they can operate the calculator as usual.

When the user inputs a number or some text (both are acceptable because it is being stored to a string), the calculator randomly selects a number between 1 and 1000, and displays it on the screen. This process will be repeated over and over again until the user either presses [ON] or [2nd][QUIT]. In any case, this should provide you with some basic humor for a minute or two.

Another way to do this, that allows for results closer to the actual answer, is to store the input to a real variable. With large calculations it is virtually undetectable and rarely give the right answer, but if the user tries to enter in anything other than a number, it will cause the program to crash.

the code for this is

:ClrHome
:While 1
:Input "",A
:Disp A+randInt(-50,50
:End

Alternatively, to guarantee that the correct answer will never be displayed, the following code can be used:

:ClrHome
:While 1
:Input "",A
:A→B
:While A=B
:A+randInt(-50,50→B
:End
:Disp B
:End

Or if you really want to be tricky, you can modify the answer only if it is a decimal and/or number larger than 1000 sometimes and sometimes give the right answer. This way people will have less of a chance of noticing that the calculator is displaying the wrong answer.

:ClrHome
:While 1
:Input "",A
:Disp A+randInt(-1,1)(fPart(A)rand+randInt(-10,10)(A>1000
:End

Routine Summary

Simulates a simple AI chatbot.

Inputs

None

Outputs

None

Variables Used

Str1, A

Calculator Compatibility

TI-83/84/+/SE

Author

alexrudd

URL: United TI

Download

chatbot.zip

:ClrHome
:Disp "What is your pro","blem?
:Repeat Str1="Shut up
:Input ">",Str1
:int(3rand→A
:">Can you say tha","t in a different","way?
:If A=1:">Can you explain ","in more detail, ","please?
:If not(A:">And how does tha","t make you feel?
:Output(1,1,Ans
:End

A Chatbot is a type of AI which is able to simulate an intelligent conversation with a person. A typical conversation consists of the person asking the chatbot questions, and the chatbot giving relevant responses. The way the chatbot determines a response is by breaking down the person's statements into the individual words and phrases, and looking up an appropriate response in its database (where its "knowledge" is stored).

Obviously, the more sophisticated a chatbot is, the larger the database of words and phrases needs to be, and likewise the larger the chatbot logic will be. In our simple chatbot, there are only three phrases that the chatbot will say, and the phrases are determined purely by random chance.

When you type in a statement, the chatbot will respond back with its own statement. You can keep "talking" with the chatbot for however long you want, but all you need to type to have it quit is just "Shut up". Because the routine uses Str1, you should clean it up at the end of your program.

VWAXES.GIF

Command Summary

Sets the v and w sequence equations to be graphed against each other.

Command Syntax

vwAxes

Menu Location

When Seq mode is enabled, press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows to select vwAxes.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

When vwAxes is enabled, and the calculator is in Seq mode, the equations v and w will be graphed against each other (that is, the points (v(n),w(n)) are graphed for the values of n between nMin and nMax). With this setting, sequence mode graphs are a bit like parametric mode, except the parameter n is always an integer, and recursive definitions are possible.

The equation u is ignored when in vwAxes mode.

See "Related Commands" for other possibilities of graphing sequences.

Error Conditions

Related Commands

UWAXES.GIF

Command Summary

Sets the u and w sequence equations to be graphed against each other.

Command Syntax

uwAxes

Menu Location

When Seq mode is enabled, press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows to select uwAxes.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

When uwAxes is enabled, and the calculator is in Seq mode, the equations u and w will be graphed against each other (that is, the points (u(n),w(n)) are graphed for the values of n between nMin and nMax). With this setting, sequence mode graphs are a bit like parametric mode, except the parameter n is always an integer, and recursive definitions are possible.

The equation v is ignored when in uwAxes mode.

See "Related Commands" for other possibilities of graphing sequences.

Error Conditions

Related Commands

UVAXES.GIF

Command Summary

Sets the u and v sequence equations to be graphed against each other.

Command Syntax

uvAxes

Menu Location

When Seq mode is enabled, press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows to select uvAxes.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

When uvAxes is enabled, and the calculator is in Seq mode, the equations u and v will be graphed against each other (that is, the points (u(n),v(n)) are graphed for the values of n between nMin and nMax). With this setting, sequence mode graphs are a bit like parametric mode, except the parameter n is always an integer, and recursive definitions are possible.

The equation w is ignored when in uvAxes mode.

See "Related Commands" for other possibilities of graphing sequences.

Error Conditions

Related Commands

WEB.GIF

Command Summary

Sets sequence equations to be graphed as web diagrams.

Command Syntax

Web

Menu Location

While in Seq mode, press:

  1. 2nd FORMAT to access the format menu.
  2. Use arrows and ENTER to select Web.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

In Web mode, sequence equations are graphed as web diagrams. This is a way of visualizing iterations of a function (that is, the sequence n, f(n), f(f(n)), f(f(f(n))), … for some function f and starting value n). For this mode to properly work, each sequence equation should be in terms of its previous value only: u(n) should be a function of u(n-1). Referencing other sequence equations, or u(n-2), will yield ERR:INVALID; referencing the value n is allowed by the calculator, but makes the result meaningless so you should avoid it.

When you go to the graph screen, the associated function y=f(x) will be graphed. That is, if you define u(n) = cos(u(n-1)), the function y=cos(x) will be graphed. If you have AxesOn enabled, the line y=x will also be graphed. It's easy to see that the intersection points of the graphs y=f(x) and the line y=x represent the fixed points (points such that f(x)=x) of the function.

The web diagram itself will be drawn if you press TRACE or use the Trace command. First you will choose the equation (u, v, or w) to trace; then, by pressing RIGHT repeatedly, the web will be drawn, starting from the initial value nMin. In a web diagram, a point (n, f(n)) on the graph of y=f(x) is connected by a horizontal segment to the point (f(n), f(n)) on the graph of y=x, and then by a vertical segment to the point (f(n), f(f(n))) on the graph of y=f(x) again; this process is repeated. Each pair of a horizontal and vertical segment represents an added iteration of.

Web diagrams can be used to look at the attracting behavior of fixed points. For example:

1. Graph the equation u(n)=cos(u(n-1)), u(nMin)=1 in Web mode, with Xmin=0, Xmax=1, Ymin=0, Ymax=1 in the WINDOW menu. You'll see that it has a single fixed point. If you TRACE the graph, the line segments will spiral around into the fixed point, so appears to be attractive.

2. Graph the equation u(n)=π/2cos(u(n-1)), u(nMin)=1 in Web mode, with Xmin=0, Xmax=π/2, Ymin=0, Ymax=π/2 in the WINDOW menu. This equation looks a lot like the previous one, and also has a single fixed point. However, if you TRACE the graph, the line segments (which start out quite close to the fixed point) will spiral away from it. This intuitively shows that the fixed point of f(x)=π/2cos(x) is not attractive.

See "Related Commands" for other possibilities of graphing sequences.

Error Conditions

  • ERR:INVALID is thrown if an equation being graphed references other sequence equations or the n-2 term.

Related Commands

TIME.GIF

Command Summary

Sets the way sequence equations are graphed to value vs. time.

Command Syntax

Time

Menu Location

While in Seq mode, press:

  1. 2nd FORMAT to access the format menu.
  2. ENTER to select Time

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

NOTE: This article is about the Time setting for sequence graphing. If you're looking for the clock commands on the TI-84 Plus and TI-84 Plus SE, see Time and Date Commands.

The Time command sets equations in sequence mode to graph as the points (n, u(n)) (for the u equation; (n, v(n)) and (n, w(n)) for the other two) - the default setting. In dot mode, only the points themselves will be plotted, but if you change the graphing style to connected line or thick line, the points will be connected.

Essentially, this mode makes sequence graphs a limited version of function graphs, but with the possibility of recursion.

See "Related Commands" for other possibilities of graphing sequences.

Related Commands

SHADE.GIF

Command Summary

Graphs two functions and shades the area between them.

Command Syntax

Shade(lower func, upper func, [xmin, xmax, pattern #, resolution])

Menu Location

Press:

  1. 2nd DRAW to access the draw menu.
  2. 7 to select Shade(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Shade( command draws two functions and shades the area between them.

Shade(lower func, upper func, [xmin, xmax, pattern #, resolution])

  • lowerfunc and upperfunc are the two functions (whenever lowerfunc<upperfunc, the area between them will be shaded)
  • xmin and xmax (optional) are left and right boundaries on where to shade.
  • pattern # (optional) is an integer 1-4 determining which pattern to use:
    • 1 — vertical shading (default)
    • 2 — horizontal shading
    • 3 — diagonal shading (negative slope)
    • 4 — diagonal shading (positive slope)
  • resolution (optional) is an integer 1-8 determining the spacing between shading lines. When it's 1 (default), everything is shaded, when it's 2, one pixel is skipped between lines, and so on - when it's 8, seven pixels are skipped.

Note that if you don't supply the resolution argument, it defaults to 1 and everything gets shaded regardless of the pattern.

Advanced Uses

Shade(Ymin,Ymax) is the smallest (though not the fastest) way to shade the entire screen.

Related Commands

See Also

EPOWER.GIF

Command Summary

Raises the constant e to the value power.

Command Syntax

e^(value)

Menu Location

Press [2nd] [ex] to paste e^(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The e^( command raises the constant e to a power. Since it's possible to just type out e, ^, and (, the reason for having a separate function isn't immediately obvious but in fact most of the time you need to use e, it's to raise it to a power.

The trigonometric and hyperbolic functions can be expressed, and in fact are usually defined, in terms of e^(.

e^( accepts numbers and lists (but unfortunately not matrices) as arguments. It also works, and is often used for, complex numbers (in fact, one of the standard forms of complex numbers on TI-83 series calculators is re^θi, which uses the e^( function)

e^(2)
        7.389056099
e^(πi)
        -1
e^({-1,0,1})
        {.3678794412 1 2.718281828}

Formulas

The e^( is usually defined by an infinite series:

(1)
\begin{align} e^x=\sum_{n=0}^\infty{\frac{x^n}{n!}} \end{align}

This is then used to define exponentiation in general (for all real and even complex numbers), rather than using some sort of definition of exponents that involves multiplying a number by itself many times (which only works for integers).

Related Commands

E.PNG

Command Summary

The mathematical constant e.

Command Syntax

e

Menu Location

Press 2nd e to paste e.

Calculator Compatibility

TI-83/84/+/SE/CSE/CE

Token Size

2 bytes

e is a constant on the TI-83 series calculators. The constant holds the approximate value of Euler's number, fairly important in calculus and other higher-level mathematics.

The approximate value, to as many digits as stored in the calculator, is 2.718281828459…

The main use of e is as the base of the exponential function e^( (which is also a separate function on the calculator), and its inverse, the natural logarithm ln(. From these functions, others such as the trigonometric functions (e.g. sin() and the hyperbolic functions (e.g. sinh() can be defined. In re^θi mode, e is used in an alternate form of expressing complex numbers.

Important as the number e is, nine times out of ten you won't need the constant itself when using your calculator, but rather the e^( and ln( functions.

Related Commands

Routine Summary

Shades in a circle.

Inputs

R - the radius of the circle
A - the X coordinate of the circle's center
B - the Y coordinate of the circle's center

Outputs

None

Variables Used

N, R, A, B

Calculator Compatibility

TI-83/84/+/SE

Author

Jutt

URL: United TI

Download

shadecircles.zip

:For(N,0,R,ΔX
:√(R²-N²
:Line(A+N,B-Ans,A+N,B+Ans
:Line(A-N,B-Ans,A-N,B+Ans
:End

Although it is possible to shade in a circle using the Shade( command (i.e., Shade(-√(R²-(X-A)²)+B,√(R²-(X-A)²)+B)), that is actually quite impractical in a real program because of its slow speed. Fortunately, you can improve upon that by using your own routine.

When graphing a circle, there are a few main things you need to know: the radius and the (X,Y) coordinates of the center. In our routine, the R variable is the radius, the A variable is the circle's X coordinate and the B variable is the circle's Y coordinate.

Rather than displaying the circle as one big circle, we are going to display it line by line using a For( loop, starting from the center. The √(R²-N² formula is based on the circle formula R2=(X–H)2+(Y–K)2, with the formula rearranged to get the respective part of the circle.

The circle should display pretty quickly, but it all depends on the values that you chose for the variables; smaller values will be faster, and likewise larger values will be slower. In addition, the circle may not display correctly if you don't have the right graph settings, so you should set your calculator to a friendly graphing window.

SIMUL.GIF

Command Summary

Puts the calculator into simultaneous graphing mode.

Command Syntax

Simul

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Simul.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

Simul puts the calculator into simultaneous graphing mode. When multiple equations are enabled at the same time, simultaneous graphing mode graphs them at the same time (as opposed to Sequential mode, in which they will be graphed one after the other)

If you use a list in an equation, as with Y1={1,2,3}X, this will graph several equations that will always graph separately, regardless of this setting, which only affects multiple functions in different equation variables.

Related Commands

SEQUENTIAL.GIF

Command Summary

Puts the calculator into sequential graphing mode.

Command Syntax

Sequential

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Sequential.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

Puts the calculator into sequential graphing mode (the default). When multiple equations are enabled at the same time, sequential graphing mode means that they will be graphed one after the other (as opposed to Simul mode, in which they will be graphed simultaneously)

If you use a list in an equation, as with Y1={1,2,3}X, this will graph several equations that will always graph separately, regardless of this setting, which only affects multiple functions in different equation variables.

Make sure not to confuse this with Seq mode, which is referred to in this guide as sequence graphing mode.

Related Commands

ENG.GIF

Command Summary

Puts the calculator in engineering notation mode.

Command Syntax

Eng

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Eng.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Eng command puts the calculator in engineering notation mode. This is a variation on scientific notation in which the exponent is restricted to be a multiple of 3 (and the mantissa can range between 1 and 1000, not including 1000 itself)

Eng
        Done
12345
        12.345e3
{1,2,3}
        {1e0 2e0 3e0}

Related Commands

SCI.GIF

Command Summary

Puts the calculator in scientific notation mode.

Command Syntax

Sci

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Sci.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Sci command puts the calculator in scientific notation mode, so that all results are displayed in scientific notation: as a (possibly fractional) number between 1 and 10 (not including 10) multiplied by a power of 10.

Sci
        Done
1000
        1e3
{1,2,3}
        {1e0 2e0 3e0}

Related Commands

NORMAL.GIF

Command Summary

Puts the calculator in "normal" mode regarding scientific notation.

Command Syntax

Normal

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. ENTER to select Normal.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Normal command puts the calculator in normal number mode, in which it only uses scientific notation for large enough numbers (10 000 000 000 or higher), negative numbers large enough in absolute value (-10 000 000 000 or lower), or numbers close enough to 0 (less than .001 and greater than -.001)

The other possible settings are Sci (which always uses scientific notation), or Eng (which uses a specific form of scientific notation based on powers of 1000)

Related Commands

Routine Summary

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

Inputs

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

Outputs

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

Variables Used

L₁, L₂, L₃, I

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

Download

listfrequency.zip

:{L₁(1→L₂
:{1→L₃
:For(I,2,dim(L₁
:If max(L₂=L₁(I:Then
:L₃+(L₂=L₁(I→L₂
:Else
:augment(L₂,{L₁(I→L₂
:augment(L₂,{1→L₃
:End:End

With our list of values stored in L₁, we store the first element of L₁ to L₂ to initialize it, and store a value of one to L₃ because that value has appeared once in the list (by default it is the first value and thus we know it appeared). We then begin looping in the second element to avoid an extra increment and then through all of the elements of L₁.

When determining the frequency of a value, we need to check to see if the particular element (in this case, L₁(I)) has already appeared in L₂. If it has, we increment (add one) to its respective frequency in L₂. However, if the value has never appeared in L₁, we add that value as a new element to the end of L₂ and also set its frequency to one. We repeat this until we have the frequency of all of the values in L₁ stored in L₂.

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

E.GIF

Command Summary

The E symbol is used for entering numbers in scientific notation.

Command Syntax

mantissa E exponent

Menu Location

Press [2nd][EE] to paste the E command.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The E symbol is used for entering numbers in scientific notation: it's short for *10^. This means that in many cases, its function is identical to that of the 10^( command (aside from the parenthesis). However, the exponent of E is limited to constant integer values ‾99 to 99.

The E symbol is used in display by the calculator for large numbers, or when in Sci (scientific) or Eng (engineering) mode.

Unlike the exponent of E, the mantissa (a special term for the A in A*10^B, in scientific notation) isn't limited in variable type: it can be a constant, a real or complex variable or expression, a list, a matrix, or even omitted entirely (and then it will be assumed to equal 1). The reason for this versatility is simple: internally, only the exponent is taken to be an actual argument for this command. The rest of the calculation is done through implied multiplication.

5E3
………………5000
E‾5
……………….00001

Advanced Uses

E99 and -E99 are often used for negative and positive infinity because the TI-83 series of calculators doesn't have an infinity symbol. Commands that often need to use infinity include solve(, fnInt(, normalcdf( (and the other distributions), and many others. The error introduced in this way is usually irrelevant, because it's less than the minimum calculator precision, anyway: E99 is mindbogglingly huge.

Optimization

Don't add the mantissa when it's 1:

1E5
should be
E5

In addition, E2 or E3 can be used as shorthand ways of writing 100 and 1000 respectively. This could be continued, in theory, for higher powers of 10, but those aren't necessary as often.

Command Timings

E is much faster than using the 10^( command or typing out 10^. The drawback, of course, is that it's limited to constant values.

Related Commands

FIX.GIF

Command Summary

Puts the calculator in fixed-point display mode, displaying value digits after the decimal.

Command Syntax

Fix value

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows to select a number 0-9 from the 2nd line.

This will paste Fix number. Outside a program, it will simply put the calculator in the appropriate mode.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Fix command puts the calculator in fixed-point display mode: all numbers will be displayed with a fixed number of digits (0-9) after the decimal, depending on the argument of Fix. This could be useful if you're trying to display potentially fractional numbers in a limited amount of space.

A note on more technical aspects: first, if more digits are available than are displayed, the calculator will round off the displayed number (but not its stored value), so 3.97 will be displayed as 4 in Fix 1 mode. Second, the Fix command can't force more than 10 significant digits to be displayed, so something like 123456789.1 will only display one decimal digit even in Fix 9 mode.

Finally, note that the Float and Fix commands only change the way numbers are displayed: they are saved in the same way in each case. Even if you're in Fix 0 mode, the calculations are not done using integers, and in general, the calculations are still done using floating-point numbers no matter the number mode. The one exception is with regressions: if you store a regression to an equation in Fix N mode, it will truncate the numbers involved before storing them to the equation, and as a result, the equation will be different.

Related Commands

FLOAT.GIF

Command Summary

Puts the calculator in floating decimal display mode.

Command Syntax

Float

Menu Location

Press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Float.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Float command makes the calculator display numbers with a "floating decimal point" — only as many digits after the decimal as needed are displayed (so whole numbers, for example, are shown without any decimal points). This is the default mode, and usually the most useful.

A technicality of displaying real numbers on the calculator: A maximum of 14 significant digits are stored in a number, but only 10 of them are actually displayed (or used for comparisons) — the rest are used for additional precision. This means that if a number is displayed as a whole number, it isn't necessarily whole. For example, 1234567890.7 will be displayed as 1234567891 (rounded to 10 significant digits), and 1.0000000003 will be displayed as 1.

This makes sense from many perspectives: if you get a result of 1.0000000003 after a calculation, odds are that this should be 1, and isn't just because of a precision error. Because the extra digits are there, though, even if they're not displayed, such a number will still be invalid for functions such as Pxl-On( or sub( that want integer arguments, and this sort of error is hard to track down.

Finally, note that the Float and Fix commands only change the way numbers are displayed: they are saved in the same way in each case. Even if you're in Fix 0 mode, the calculations are not done using integers, and in general the calculations are still done using floating-point numbers no matter the number mode. The one exception is with regressions: if you store a regression to an equation in Fix N mode, it will truncate the numbers involved before storing them to the equation, and as a result, the equation will be different.

Related Commands

DOT.GIF

Command Summary

Sets all equations to use the dotted-line graphing style, and makes it the default setting.

Command Syntax

Dot

Menu Location

Press:

  1. MODE to access the mode menu.
  2. Use arrows to select Dot.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The Dot command sets all equations to use the disconnected "dotted-line" graph style: it calculates and draws points on the graph, but doesn't connect them. In addition, this graph style is made the default, so that when a variable is deleted it will revert to this graph style. The other possible setting for this option is Connected.

Compare this to the GraphStyle( command, which puts a single equation into a specified graph style.

The Connected and Dot commands don't depend on graphing mode, and will always affect all functions, even in other graphing modes. The exception to this is that sequence mode's default is always the dotted-line style, even when Connected mode is set. The Connected command will still change their graphing style, it just won't change the default they revert to.

In addition to graphing equations, this setting also affects the output of DrawF, DrawInv, and Tangent(.

Advanced Uses

Functions graphed using the dotted-line graph style are very strongly affected by the Xres setting (which determines how many points on a graph are chosen to be graphed). If Xres is a high setting (which means many pixels are skipped), functions in dotted-line mode will be made up of fewer points (in connected mode, this will also be the case, but because the points are connected this isn't as noticeable). You should probably set Xres to 1 if you're going to be using the dotted-line graph style — even 2 is pushing it.

Related Commands

CONNECTED.GIF

Command Summary

Sets all equations to use the connected graphing style, and makes it the default setting.

Command Syntax

Connected

Menu Location

Press:

  1. MODE to access the mode menu.
  2. Use arrows to select Connected.

Calculator Compatibility

TI-83/84/+/SE (Not available on TI-84+CE calculators)

Token Size

2 bytes

The Connected command sets all equations to use the usual graph style - a connected line. In addition, this graph style is made the default, so that when a variable is deleted it will revert to this graph style. The other possible setting for this option is Dot.

Compare this to the GraphStyle( command, which puts a single equation into a specified graph style.

The Connected and Dot commands don't depend on graphing mode, and will always affect all functions, even in other graphing modes. The exception to this is that sequence mode's default is always the dotted-line style, even when Connected mode is set. The Connected command will still change their graphing style, it just won't change the default they revert to.

In addition to graphing equations, this setting also affects the output of DrawF, DrawInv, and Tangent(.

Related Commands

SQUAREROOT.PNG

Command Summary

Take the square root of a number.

Command Syntax

√(input)

Menu Location

Press 2nd √ to paste the √( command.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

Takes the square root of a positive or negative number. It works exactly the same as 2×√ or ^(1/2) but is smaller and uses an ending parenthesis. If used on a list, it will return a list with the square root of each element.

√(4)
        2
√(2)
        1.414213562

√({1,-1})
        {1 i}

This may return a complex number or throw ERR:NONREAL ANS (depending on mode settings) if taking the square root of a negative number.

Optimization

Never raise something to the one-half power explicitly; use this command instead.

:X^(1/2)→X
can be
:√(X→X

Error Conditions

Related Commands

INVERSE.GIF

Command Summary

Returns the reciprocal of a number (1 divided by the number). For matrices, finds the matrix inverse.

Command Syntax

valueֿ¹

Menu Location

Press [xֿ¹]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ֿ¹ command returns the reciprocal of a number, equivalent to dividing 1 by the number (although reciprocals are sometimes more convenient to type). It also works for lists, by calculating the reciprocal of each element.

The ֿ¹ command can also be used on matrices, but it is the matrix inverse that is computed, not the reciprocal of each element. If [A] is an N by N (square) matrix, then [A]ֿ¹ is the N by N matrix such that [A][A]ֿ¹=[A]ֿ¹[A] is the identity matrix. ֿ¹ does not work on non-square matrices.

4ֿ¹
        .25
{1,2,3}ֿ¹
        {1 .5 .3333333333}
[[3,2][4,3]]ֿ¹
        [[3  -2]
         [-4 3 ]]

Much like the number 0 does not have a reciprocal, some square matrices do not have inverses (they are called singular matrices) and you'll get an error when you try to invert them.

Optimization

Writing Aֿ¹B instead of B/A is sometimes beneficial when B is a complicated expression, because it allows you to take off closing parentheses of B. For example:

:(P+√(P²-4Q))/2
can be
:2ֿ¹(P+√(P²-4Q

This may be slower than dividing. There are also situations in which this optimization might lose precision, especially when the number being divided is large:

7fPart(4292/7
        1
7fPart(7ֿ¹4292
        .9999999999

Error Conditions

Related Commands

Routine Summary

Calculates the day of week of a date, without using dayOfWk( (because it's only available on the 84+ and 84+SE)

Inputs

D - The day
M - The month
Y - The year (1950 through 2049)

Outputs

Ans - 0-6 = the day of week (Sunday - Saturday)

Variables Used

D, M, Y, Ans

Calculator Compatibility

TI-83/84/+/SE

Download

weekday.zip

:round(7fPart(dbd(101.5,DE2+M+fPart(.01Y))/7

Using the dbd( command, we return the number of days between the given date and January 1, 1950, our base date. dbd('s argument, in this case, is of the form DDMM.YY, so we put the date we're given in that form with DE2+M+fPart(.01Y. Once we have the number of days between the two dates, we divide it by seven (as there are seven days in a week) to get the number of weeks.

However, we are not interested in the number of weeks between two dates, we are interested in how far into the week we are. That would be the fractional part of the number of weeks. For example, if there was fourteen days between two dates (the first date being a Sunday) and we divide that by seven, we would have the equation 14/7=2.00. The .00 means that the week hasn't yet begun (and so, the day is Sunday).

If there was 15 days between two dates, the equation would give 15/7=2.1428571. The .1428571 means that we are .1428571 into the week, and if we multiply that by seven, we get the equation .1428571*7=1. This means that we are one day into the week (and so, the day is Monday). So in our formula, after finding out the number of days between two dates, we find the fractional part of it, and multiply that by seven. Finally, round( gets rid of any minor rounding errors.

As the 1st of January, 1950 was a Sunday (which is the date we have inputed into the above routine), so the number of days into the week will always be relative to Sunday. That is, the output 0 through 6 is relative to the days Sunday through Saturday respectively. If you want 0 to be Monday instead, make the base date January 2 instead by changing 101.5 to 201.5.

This routine can handle dates from January 1, 1950 to December 31, 2049. For other dates, it will assume the year is in that range instead. There is also an alternative routine that handles dates in an unlimited range.

Display Day

Append the following code to display the day of the week:

:Disp sub("SUNDAY***MONDAY***TUESDAY**WEDNESDAYTHURSDAY*FRIDAY***SATURDAY*",9Ans+1,9      //replace *s with spaces

Or this code, which should display the day of the week, only the display method takes less space and space pads it.
Disp sub("***SUN***MON**TUESWEDNES*THURS***FRI*SATUR",6Ans+1,6)+"DAY       //replace *s with spaces

Error Conditions

Related Routines

Two-byte tokens beginning with the byte 0xBB are miscellaneous tokens, used for various commands that didn't fit in the one-byte range. With later OS versions, various symbols were also added to the 0xBB tokens.

The two tables on this page are split by calculator type, which means that (among other things) the tokens in the second table can't be sent to a TI-83 calculator from a TI-83+ calculator. Further version differences: tokens CF through DA are available with OS 1.15 or higher. Tokens DB through F5 are available with OS 1.16 or higher.

Miscellaneous 2-Byte Tokens (0x00 - 0x67)
0 1 2 3 4 5 6
0 npv( normalcdf( tvm_Pmt ►Polar χ²-Test( ExprOn unused
1 irr( invNorm( tvm_I% e ZInterval ExprOff unused
2 bal( tcdf( tvm_PV SinReg 2-SampZInt( ClrAllLists unused
3 Σprn( χ²cdf( tvm_N Logistic 1-PropZInt( GetCalc( unused
4 ΣInt( Fcdf( tvm_FV LinRegTTest 2-PropZInt( DelVar G-T
5 ►Nom( binompdf( conj( ShadeNorm( GraphStyle( Equ►String( ZoomFit
6 ►Eff( binomcdf( real( Shade_t( 2-SampTTest String►Equ( DiagnosticOn
7 dbd( poissonpdf( imag( Shadeχ² 2-SampFTest Clear Entries DiagnosticOff
8 lcm( poissoncdf( angle( ShadeF( TInterval Select( (next table)
9 gcd( geometpdf( cumSum( Matr►list( 2-SampTInt ANOVA( (next table)
A randInt( geometcdf( expr( List►matr( SetUpEditor ModBoxplot (next table)
B randBin( normalpdf( length( Z-Test( Pmt_End NormProbPlot (next table)
C sub( tpdf( ΔList( T-Test Pmt_Bgn unused (next table)
D stdDev( χ²pdf( ref( 2-SampZTest( Real unused (next table)
E variance( Fpdf( rref( 1-PropZTest( re^θi unused (next table)
F inString( randNorm( ►Rect 2-PropZTest( a+bi unused (next table)
Miscellaneous 2-Byte Tokens (0x68 - 0xF5)
6 7 8 9 A B C D E F
0 (prev. table) Â Î Û β a p reserved 0 x
1 (prev. table) Ä Ï Ü γ b q @ 1
2 (prev. table) á í ú Δ c r # 2 EFh_LUpBlk.gif
3 (prev. table) à ì ù δ d s $ 3 F0h_LDnBlk.gif
4 (prev. table) â î û ε e t & 4
5 (prev. table) ä ï ü λ f u ` 5 7Fh_LinvEQ.gif
6 (prev. table) É Ó Ç μ g v ; 6
7 (prev. table) È Ò ç π h w \ 7
8 Archive Ê Ô Ñ ρ i x | 8
9 UnArchive Ë Ö ñ Σ j y _ 9
A Asm( é ó ´ unused k z % 10
B AsmComp( è ò ` φ unused σ
C AsmPrgm ê ô ¨ Ω l τ
D compiled asm ë ö ¿ $\hat{p}$ m Í ß
E Á unused Ú ¡ χ n GarbageCollect x
F À Ì Ù α F o ~ T unused

Routine Summary

Returns the sum of the elements of a matrix.

Inputs

[A] - the matrix whose elements you want to sum

Outputs

Ans - the sum of the matrix elements

Variables Used

[A], L₁, Ans

Calculator Compatibility

TI-83/84/+/SE

Author

zada

URL: United TI

Download

sumofmatrix.zip

:dim([A]
:Matr►list(cumSum([A])T,Ans(1),L₁
:sum(L₁

The cumSum( command gets the cumulative sum of each column in the matrix, adding the value of the previous element to the next element, and repeating this for each consecutive element in the column. When the cumSum( command is finished, the last element in each column will contain the sum of that column. Taking the T (transpose) of the resulting matrix switches columns and rows.

Then, using the Matr►list( command, the last column of this result is stored to L₁. This column was originally the last row of cumSum('s output, so it contains all the column sums. Finally, by calculating the sum of that list, we get the total of the matrix elements. L₁ is no longer necessary, and can be deleted.

If you want to use the sum for future use, you can store it to a more permanent variable, such as A or X. When you are done using [A], you should clean it up at the end of your program.

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

  • e, the mathematical natural logarithmic base constant.
  • e^(, the exponent command raising an expression to the e constant.
  • E, the scientific notation command for expressing very large or small numbers.

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

SQUARE.GIF

Command Summary

Raises the input to the second power.

Command Syntax

value²

Menu Location

Press [x²]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ² command raises an input to the second power. It has exactly the same function as "^2", but is one byte smaller. If used on a list, it will return a list with all of the elements squared. If used on a matrix, it will return the second matrix power of the input matrix.

2²
        4
{1,‾2,3}²
        {1 4 9}
[[2,‾1][‾3,0]]²
        [[1  ‾2]
         [6 ‾3]]

Optimization

Use this command instead of ^2 in all instances.

:X^2
can be
:X²

Related Commands

DMS.GIF

Command Summary

Formats a displayed number as a degree-minute-second angle.

Command Syntax

value►DMS

Menu Location

Press:

  1. 2nd ANGLE to access the angle menu.
  2. 4 to select ►DMS, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The ►DMS command can be used when displaying a real number on the home screen, or with the Disp and Pause commands. It will then format the number as an angle with degree, minute, and second parts.

30►DMS
    30°0'0"
100/9°►DMS
    11°6'40"

It will also work when displaying a number by putting it on the last line of a program by itself. It does not work with Output(, Text(, or any other more complicated display commands.

Although ►DMS is meant as a way to format angles in Degree mode, it doesn't depend on the angle mode chosen, only on the number itself. Note that entering a number as degree°minute'second" will also work, in any mode, and it will not be converted to radians in Radian mode.

Error Conditions

  • ERR:SYNTAX is thrown if the command is used somewhere other than the allowed display commands.
  • ERR:DATA TYPE is thrown if the value is complex, or if given a list or matrix as argument.

Related Commands

RTOPTHETA.GIF

Command Summary

R►Pθ( calculates the angle coordinate (in polar coordinates) given the Cartesian coordinates.

Command Syntax

R►Pθ(x,y)

Menu Location

Press:

  1. 2nd ANGLE to access the angle menu.
  2. 6 to select R►Pθ(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

R►Pθ( (Rectangular to polar θ) takes the (x,y) (Cartesian) coordinate, and returns the angle that the ray from (0,0) to (x,y) makes with the positive x-axis. This is the θ-coordinate of the same point in (r,θ) (polar) mode. The identity used for this conversion is tan(θ)=y/x, with the correct inverse being chosen depending on the quadrant that the point is in. The range of the angle returned is -π<θ≤π. R►Pθ( can also be used on lists.

R►Pθ( is equivalent to the atan2() instruction seen in C/++ and FORTRAN.

R►Pθ(3,4)
    .927295218
tanֿ¹(4/3)
    .927295218
R►Pθ(0,{1,-1})
    {1.570796327, -1.57096327}

R►Pθ( is affected by Degree and Radian mode in its output, which is an angle measured in degrees or radians respectively.

Advanced Uses

If you want the result to always be a radian angle, regardless of mode settings, you can divide the result by 1r:

R►Pθ(x,y)/1^^r

If you want the result to always be a degree angle, regardless of mode settings, you can divide the result by 1°:

R►Pθ(x,y)/1°

Error Conditions

Related Commands

RTOPR.GIF

Command Summary

R►Pr( calculates the radius component (in polar coordinates) given the Cartesian coordinates.

Command Syntax

R►Pr(x,y)

Menu Location

Press:

  1. 2nd ANGLE to access the angle menu.
  2. 5 to select R►Pr(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

R►Pr( (Rectangular to polar radius) takes the (x,y) (Cartesian) coordinates, and gives the radius coordinate r of the same point in (r,θ) (polar) mode. The identity used for this conversion is r² = x²+y²

R►Pr(3,4)
    5
√(3²+4²)
    5
R►Pr({6,5},{8,12})
    {10 13}

The function works even when the equivalent √(x²+y²) fails due to overflow:

R►Pr(3e99,4e99)
    5e99

Optimization

R►Pr( is the smallest way to implement the distance formula $d=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$. Just give the values x1-x2 and y1 - y2 as arguments:

:√((5-2)²+(4-0)²)
can be
:R►Pr(5-2,4-0)

Error Conditions

Related Commands

PTORY.GIF

Command Summary

P►Ry( calculates the y-value (in Cartesian coordinates) given Polar coordinates.

Command Syntax

P►Ry(r,θ)

Menu Location

Press:

  1. 2nd ANGLE to access the angle menu.
  2. 8 to select P►Ry(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

P►Ry( (polar to rectangular y-coordinate) calculates the y-coordinate of a polar point. Polar coordinates are of the form (r,θ), where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). The conversion identity y=r*sin(θ) is used to calculate P►Ry(.

The value returned depends on whether the calculator is in radian or degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The P►Ry( command also accepts a list of points.

P►Ry(5,π/4)
    3.535533906
5*sin(π/4)
    3.535533906
P►Ry({1,2},{π/4,π/3})
    {.7071067812 1.732050808}

Advanced Uses

You can bypass the mode setting by using the ° (degree) and r (radian) symbols. This next command will return the same values no matter if your calculator is in degrees or radians:

P►Ry(1,{π/4^^r,60°})
    {.7071067812 .8660254038}

Optimization

In most cases P►Ry(r,θ) can be replaced by r*sin(θ) to save a byte:

:P►Ry(5,π/12)
can be
:5sin(π/12)

Conversely, complicated expressions multiplied by a sine factor can be simplified by using P►Ry(r,θ) instead.

:(A+BX)sin(π/5)
can be
:P►Ry(A+BX,π/5)

Error Conditions

Related Commands

Routine Summary

Displays random lines.

Inputs

None

Outputs

None

Variables Used

A, B, C

Calculator Compatibility

TI-83/84/+/SE

Download

randomlines.zip

:ClrDraw
:ZStandard
:Delvar ADelvar B
:Repeat getKey
:randInt(Xmin,Xmax→C
:randInt(Ymin,Ymax
:Line(A,B,C,Ans
:Ans→B:C→A
:End

Before we can start displaying random lines on the graph screen, we need to perform some basic setup. We then create two variables for the first (X,Y) coordinate by setting their initial values to zero. Once inside the Repeat loop, we randomly select the second (X,Y) coordinate for the line. (Please note we didn't need to store the second variable, since Ans is able to hold a numeric value, and it is also faster.)

Now that we have the two coordinates for the line figured out, we draw the line on the screen and store the first coordinate values to the second coordinate values, i.e., the second coordinate becomes the new first coordinate. This gets repeated over and over again until you press a key.

Routine Summary

Displays the Sierpinski Triangle.

Inputs

None

Outputs

None

Variables Used

L₁, L₂, A, B, C

Calculator Compatibility

TI-83/84/+/SE

Author

Weregoose

URL: United TI

Download

sierpinski.zip

:ClrDraw
:0→Xmin:2→Xmax
:0→Ymin:1→Ymax
:rand→A:rand→B
:{0,1,2→L₁
:{0,1,0→L₂
:Repeat getKey
:randInt(1,3→C
:mean({A,L₁(C→A
:mean({B,L₂(C→B
:Pt-On(A,B
:End

A Sierpinski triangle is a very common fractal that almost everybody has seen. It consists of a large triangle divided into three smaller triangles, which are then themselves divided into three smaller triangles, and this is repeated infinitely until the triangles are so small you can barely see them.

In order to construct a Sierpinski triangle on the calculator, you need to use the graph screen. Before we can use the graph screen, however, we need to perform some basic setup. We then create our variables: two lists (one for the X coordinates and one for the Y coordinates) and two numerics (one for a random X number and one for a random Y number).

Once we have our variables created, we start randomly coming up with places to display the pixels that will make up the triangle. Based on the formula used to generate the triangle, we take the average of the random list values and the random numbers that were generated, and use those for the coordinates of the next pixel. This gets repeated over and over again until either the triangle is completed or you press a key.

PRINTSCREEN.GIF

Command Summary

This command doesn't exist. A token for it does, though.

Command Syntax

PrintScreen

Menu Location

This command requires a hex editor to access.

Calculator Compatibility

TI-82

Token Size

1 byte

On the TI-82, the PrintScreen command could be found in the I/O submenu of the PRGM menu. According to the TI-82 manual, it "prints the current screen on a printer attached to an IBM®-compatible computer or a Macintosh® if you are using TI-GRAPH LINK™ software". Aside from this potential interaction with computers, it was otherwise equivalent to Pause.

On the TI-83 series calculators or higher, a token is still set aside for the PrintScreen command. However, the command doesn't actually do anything, and will cause an error if you try to use it. It's not accessible through any menus, though, so that's okay.

The only potential use is to save on memory if you ever need to display "PrintScreen" somewhere - you can display this token instead.

Error Conditions

  • ERR:INVALID occurs if this statement is used outside a program.
  • ERR:INVALID also occurs if this statement is used inside a program.

Routine Summary

Displays the Pythagorean triples.

Inputs

C - how many triples you want to display

Outputs

None

Variables Used

A, B, C

Calculator Compatibility

TI-83/84/+/SE

Author

Weregoose

URL: United TI

Download

pythagoreantriples.zip

:For(A,2,C
:For(B,1,A-1
:Disp {A²-B²,2AB,A²+B²
:If getKey:Pause
:End:End

A Pythagorean triple occurs when, while using the Pythagorean Theorem a2+b2=c2 to find the three sides of a right triangle, all three values are whole integers. For example, a common triple is 3,4,5 — in this case, 9 (32) + 16 (42) = 25 (52). The general formula that can be derived to figure out when a triple occurs is: a=(A2-B2) b=(2AB) c=(A2+B2).

Now that you know what a Pythagorean triple is, the routine should be pretty clear. We are essentially looping over the range of values that we want to find triples in, and then displaying the triples as a three element list using the above mentioned formula. Because there can be many triples found, and displaying all of them would just be like a blur on the screen, the Pause command allows you to temporarily halt the program so you can see the triples that are currently displayed.

TI-Basic features are fairly extensive set of commands and functionality, which allows you to do almost anything you want. This tutorial provides a brief overview of some of these things, along with links to further documentation available elsewhere on the wiki.

Basic Syntax

A TI-Basic program consists of one or more statements, which can be commands, functions, or combination thereof. However, there are some general rules that you need to follow concerning syntax when using statements:

While a command or function looks like it just made up of individual characters that you can type in, it is in fact a token that must be obtained in the appropriate menu or by pressing a key on the calculator. Using tokens allows the calculator to quickly lookup a command or function, rather than having to compile it together before you can use it.

Each statement gets placed on its own line, which starts with a colon. The calculator automatically puts a colon at the beginning of the line, which cannot be edited. If you delete the line, however, the colon gets deleted as well. In addition to the built-in colons, you can artificially put multiple statements on the same line by separating each one with a colon. The calculator treats each of these statements as being on their own line.

There is no built-in support for comments, although you can make your own by using strings. If you place a string of text inside a double quote on its own line, the calculator will simply read through this and not do anything with it. The calculator does not allow you to put quotes or the store arrow inside a string because those are used for indicating the beginning and end of the string.

Whitespace is not allowed between the arguments of a command or function, and will cause an error if you try to put it there. However, if you have whitespace inside a string, the space is preserved by the calculator, and will impact how the string appears on the screen or gets used in the program. In addition, blank lines in a program are perfectly legal, although they do take up space.

You can omit the closing parenthesis, quote, square bracket, curly brace, etc. at the end of a command or function. Each of these things take up space, and will impact the size of a program. However, if you have a complex expression involving lots of math, or you have multiple commands on one line, then you should keep them.

(for more information, see Tokens and Token Size, Code Conventions, and Commenting Your Code)

Variable Types

TI-Basic has four main built-in variable types: numerics, lists, matrices, and strings. Unlike other programming languages, TI-Basic does not allow you to create your own variables (with the exception of custom lists), and all of the variables are available globally across the calculator. You can use the variables inside functions and commands, and even combine several of them together to make new variables.

Numerics

A numeric represents a single number value, such as -5 or 2683.45, and there are 27 numeric variables (A-Z and theta). A value can be either real or complex (meaning it is an imaginary number), and the calculator represents each number as a floating point, with 14 decimal positions stored (although only 10 are accessible).

:5→A

Lists

A list represents a collection of expressions, consisting of numbers and/or numeric variables, stored together as one variable. There are six built-in list variables (L1,…,L6). You can also make your own custom list by using the little L character. When you construct a list, you need to put an opening curly brace, and then separate each value with a comma. You can have up to 999 values in a list.

:{1,B,2,C→L1

Matrices

A matrix represents a collection of expressions, consisting of numbers and/or numeric variables, stored together as one two-dimensional (row x column) variable. There are ten built-in matrix variables ([A],…[J]). When you construct a matrix, you need to put an opening square bracket, place an opening and closing bracket around each row, and separate each value with a comma. You can have up to 99x99 in a matrix.

:[[1,2,3][4,5,6→[A]

Strings

A string represents a sequence of characters, consisting of letters, numbers, symbols, commands, and functions, stored together as one variable. There are ten built-in string variables (Str1,…,Str0). When you construct a string, you need to put an opening double quote, and then list the characters one after another. A string's size is limited only by the amount of free RAM available.

:"ABC DEF 123→Str1

(for more information, see Variable Types)

Program Flow

TI-Basic has the majority of the standard conditional and looping structures that you find in other programming languages. A condition can be almost anything, including values, variables, or a combination thereof. Because of the way that TI-Basic interprets expressions, a condition is true if its value is one or non-zero, and false if its value is zero.

Conditionals

The simplest conditional involves just using the If command. You usually only use this when you just have one command or statement that you want to be executed. If you have two or more statements that you want executed when the conditional is true, you need to add a Then and End command to the If statement. The Then goes on the line right after the If command, and the End command goes after all of the statements that you want executed.

The most complicated conditional is when you want to execute certain statements if the condition is true, and other statements if the condition is false. The conditional looks essentially the same as the multi-line conditional, with the only difference being that you insert an Else command in between the true and false statements.

:If A=2:Then
:Disp "A was 2
:A→B
:End

Loops

There are three different kinds of loops: While, Repeat, and For(. A While loop loops while the condition is true, whereas a Repeat loop repeats itself until the condition is true. A For( loop is essentially a specialized While loop, with the main differences being that it loops a set number of times and it has the condition built-in.

:For(X,1,8
:Output(X,1,"Hello
:End

Branching

Branching allows the calculator to jump from one point in a program to another. You use the Goto and Lbl commands together to achieve this. The Lbl command specifies a location in the program, and the Goto command tells the program to jump to the location with the matching label. Loops are generally preferred over branching because it has some major disadvantages associated with using it.

:Goto A
...
:Lbl A

(for more information, see Controlling Program Flow and Logical Operators)

<< Introduction to TI-Basic Table of Contents Your First Program >>
RETHETAI.GIF

Command Summary

Puts the calculator into re^θi mode.

Command Syntax

re^θi

Menu Location

Press:

  1. MODE to access the mode menu.
  2. Use the arrow keys and ENTER to select re^θi

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The re^θi command puts the calculator into polar complex number mode. This means that:

  • Taking square roots of negative numbers, and similar operations, no longer returns an error.
  • Complex results are displayed in the form re^(θi) (hence the name of the command)

The mathematical underpinning of this complex number format is due to the fact that if (x,y) is a point in the plane using the normal coordinates, it can also be represented using coordinates (r,θ) where r is the distance from the origin and θ is the angle that the line segment to the point from the origin makes to the positive x-axis (see Polar and PolarGC for more information on polar coordinates and graphing). What does this have to do with complex numbers? Simple: if x+yi is a complex number in normal (rectangular) form, and re^(θi) is the same number in polar form, then (x,y) and (r,θ) represent the same point in the plane.

Of course, that has a lot to do with how you define imaginary exponents, which isn't that obvious.

An equivalent form to polar form is the form r[cos(θ)+isin(θ)].

Unfortunately, the calculator seems to have some confusion about the use of degree and radian angle measures for θ in this mode (the answer is: you can only use radians — degrees make no sense with complex exponents). When calculating a value re^(θi) by using the e^( command and plugging in numbers, the calculator assumes θ is a radian angle, whether it's in Degree or Radian mode. However, when displaying a complex number as re^(θi), the calculator will display θ in radian or degree measure, whichever is enabled. This may lead to such pathological output as:

Degree:re^θi
        Done
e^(πi)
        1e^(180i)
Ans=e^(180i)
        0 (false)

It's recommended, then, to use Radian mode whenever you're in re^θi mode.

Related Commands

APLUSBI.GIF

Command Summary

Puts the calculator into a+bi mode.

Command Syntax

a+bi

Menu Location

Press:

  1. MODE to access the mode menu.
  2. Use the arrow keys and ENTER to select a+bi

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The a+bi command puts the calculator into rectangular complex number mode. This means that:

  • Taking square roots of negative numbers, and similar operations, no longer returns an error.
  • Complex results are displayed in the form a+bi (hence the name of the command)

This is the standard way of displaying complex numbers, though they can also be displayed in polar form (see re^θi for more details). To extract the coefficients a and b, use the real( and imag( commands.

Advanced Uses

Rather than switch to a+bi mode, you might want to force the calculations to use complex numbers by making the original argument complex. The general way to do this is by adding +0i to the number. However, there may be an optimization in any particular case. See the quadratic formula routine for a good example of this.

Real
        Done
√(-1)    
        (causes an error)
√(-1+0i)        
        i

Related Commands

See Also

REAL.GIF

Command Summary

Enables real number only mode.

Command Syntax

Real

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Real.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Real command puts the calculator in real number-only mode. This shouldn't be taken quite literally, as you can still type in i to get complex numbers, and do operations with them (they will be displayed as in a+bi mode, in that case). However, any operation done with real numbers that comes out to a complex result, such as taking the square root of a negative number, will throw a ERR:NONREAL ANS error.

There is no real advantage to using Real mode over a+bi mode — it just adds another error condition that wouldn't be triggered otherwise. However, it is the default setting, and so there's a good chance that the calculator will be in Real mode when someone runs your program. Thus, when using complex numbers implicitly (such as in a quadratic equation solver) you should do something about this.

Advanced Uses

Rather than switch to a+bi mode, you might want to force the calculations to use complex numbers by making the original argument complex. The general way to do this is by adding +0i to the number. However, there may be an optimization in any particular case. See the quadratic formula routine for a good example of this.

Real
        Done
√(-1)    
        (causes an error)
√(-1+0i)        
        i

Related Commands

See Also

DEGREE.GIF

Command Summary

Puts the calculator in Degree mode.

Command Syntax

Degree

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Degree.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Degree command puts the calculator into Degree mode, where the inputs and/or outputs to trig functions are assumed to be degree angles.

Angles measured in degrees range from 0 to 360, with 0 being an empty angle, 90 being a right angle, 180 being a straight angle, and 360 being a full angle all the way around a circle.

To convert from a radian angle to a degree angle, multiply by 180/π. To go the other way, and get a radian angle from a degree angle, multiply by π/180.

The following commands are affected by whether the calculator is in Radian or Degree mode:

The input is differently interpreted:

The output is differently expressed:

However, some commands are notably unaffected by angle mode, even though they involve angles, and this may cause confusion. This happens with the SinReg command, which assumes that the calculator is in Radian mode even when it's not. As a result, the regression model it generates will graph incorrectly in Degree mode.

Also, complex numbers in polar form are an endless source of confusion. The angle( command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the e^( command), defined as $e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following:

Degree:re^θi
        Done
e^(πi)
        1e^(180i)
Ans=e^(180i)
        0 (false)

Overall, it's better to put your calculator in Radian mode when dealing with polar form of complex numbers, especially since no mathematician would ever use degrees for the purpose anyway.

Optimization

It's sometimes beneficial to use the ° symbol instead of switching to Degree mode. The ° symbol will make sure a number is interpreted as a degree angle, even in Radian mode, so that, for example:

Radian
        Done
sin(90)
        -.8011526357
sin(90°)
        1

This is smaller when only one trig calculation needs to be done. Also, it doesn't change the user's settings, which are good to preserve whenever possible.

Related Commands

RADIAN.GIF

Command Summary

Puts the calculator in Radian mode.

Command Syntax

Radian

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows and ENTER to select Radian.

Calculator Compatibility

TI-83/84/+/SE/CE

Token Size

1 byte

The Radian command puts the calculator into Radian mode, where the inputs and/or outputs to trig functions are assumed to be radian angles.

Angles measured in radians range from 0 to 2π. They are defined as the arc length of the arc, on a unit circle (circle with radius 1), that corresponds to the angle when it is placed in the center. This definition actually only differs from degree measurements by a constant factor.

To convert from a degree angle to a radian angle, multiply by 180/π. To go the other way, and get a radian angle from a degree angle, multiply by π/180.

The following commands are affected by whether the calculator is in Radian or Degree mode:

The input is differently interpreted:

The output is differently expressed:

However, some commands are notably unaffected by angle mode, even though they involve angles, and this may cause confusion. This happens with the SinReg command, which assumes that the calculator is in Radian mode even when it's not. As a result, the regression model it generates will graph incorrectly in Degree mode.

Also, complex numbers in polar form are an endless source of confusion. The angle( command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the e^( command), defined as $e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following:

Degree:re^θi
        Done
e^(πi)
        1e^(180i)
Ans=e^(180i)
        0 (false)

Overall, it's better to put your calculator in Radian mode when dealing with polar form of complex numbers, especially since no mathematician would ever use degrees for the purpose anyway.

Optimization

It's sometimes beneficial to use the r command instead of switching to Radian mode. The r symbol will make sure a number is interpreted as a radian angle, even in degree mode, so that, for example:

Degree
………………Done
sin(π)
……………….0548036651
sin(πr)
………………0

This is smaller when only one trig calculation needs to be done. Also, it doesn't change the user's settings, which are good to preserve whenever possible.

Related Commands

TANHINVERSE.GIF

Command Summary

Calculates the inverse hyperbolic tangent of a value.

Command Syntax

tanhֿ¹(value)

Menu Location

The tanhֿ¹( command is only found in the catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. T to skip to commands starting with T.
  3. Scroll down and select tanhֿ¹(

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The tanhֿ¹( command calculates the inverse hyperbolic tangent of a value. tanhֿ¹(x) is the number y such that x = tanh(y).

tanhֿ¹(x), although it can be defined for all real and complex numbers, is real-valued only for x in the open interval (-1,1). Since Z80 calculators have their hyperbolic functions and inverses restricted to real values, ERR:DOMAIN is thrown when x is outside the interval (-1,1).

The tanhֿ¹( command also works for lists.

tanhֿ¹(0)
    0
tanhֿ¹({-.5,.5})
    {-.5493061443 .5493061443}

Error Conditions

  • ERR:DOMAIN when taking the inverse tanh of a number not between -1 and 1.

Related Commands

COSHINVERSE.GIF

Command Summary

Calculates the inverse hyperbolic cosine of a value.

Command Syntax

coshֿ¹(value)

Menu Location

The coshֿ¹( command can only be found in the catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. C to skip to commands starting with C.
  3. Scroll down and select coshֿ¹(

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The coshֿ¹( function gives the inverse hyperbolic cosine of a value. coshֿ¹(x) is the number y such that x = cosh(y).

Although coshֿ¹(x) can be defined for all real and complex numbers, it assumes real values only for x≥1. Since hyperbolic functions in the Z80 calculators are restricted only to real values, ERR:DOMAIN is thrown when x<1.

The coshֿ¹( command also works for lists.

coshֿ¹(1)
    0
coshֿ¹({2,3})
    {1.316957897 1.762747174}

Error Conditions

  • ERR:DOMAIN when taking the inverse cosh of a number less than 1.

Related Commands

SINHINVERSE.GIF

Command Summary

Calculates the inverse hyperbolic sine of a value.

Command Syntax

sinhֿ¹(value)

Menu Location

The sinhֿ¹( command is only found in the catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. S to skip to commands starting with S.
  3. Scroll down and select sinhֿ¹(

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The sinhֿ¹( command calculates the inverse hyperbolic sine of a value. sinhֿ¹(x) is the number y such that x = sinh(y). Unlike for the standard trig functions, this uniquely determines the inverse hyperbolic sine of any real number.

The sinhֿ¹( command also works for lists.

sinhֿ¹(0)
    0
sinhֿ¹({1,2,3})
    {.881373587 1.443635475 1.818446459}

Related Commands

RECT.GIF

Command Summary

Formats a complex value in rectangular form when displaying it.

Command Syntax

value►Rect

Menu Location

Press:

  1. MATH to access the math menu.
  2. RIGHT RIGHT to access the CPX submenu.
  3. 6 to select ►Rect, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The ►Rect command can be used when displaying a complex number on the home screen, or with the Disp and Pause commands. It will then format the number as though a+bi mode were enabled, even when it's not. It also works with lists.

i►Polar
    1e^(1.570796327i)
Ans►Rect
    i

It will also work when displaying a number by putting it on the last line of a program by itself. It does not work with Output(, Text(, or any other more complicated display commands.

To actually separate a number into the components of rectangular form, use real( and imag(.

Error Conditions

  • ERR:SYNTAX is thrown if the command is used somewhere other than the allowed display commands.
  • ERR:DATA TYPE is thrown if the value is real.

Related Commands

POLAR.GIF

Command Summary

Formats a complex value in polar form when displaying it.

Command Syntax

value►Polar

Menu Location

Press:

  1. MATH to access the math menu.
  2. RIGHT RIGHT to access the CPX submenu.
  3. 7 to select ►Polar, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The ►Polar command can be used when displaying a complex number on the home screen, or with the Disp and Pause commands. It will then format the number as though re^θi mode were enabled. It also works with lists.

i
    i
i►Polar
    1e^(1.570796327i)
{1,i}►Polar
    {1 1e^(1.570796327i)}

It will also work when displaying a number by putting it on the last line of a program by itself. It does not work with Output(, Text(, or any other more complicated display commands.

To actually separate a number into the components of polar form, use abs( and angle(.

Error Conditions

  • ERR:SYNTAX is thrown if the command is used somewhere other than the allowed display commands.
  • ERR:DATA TYPE is thrown if the value is real.

Related Commands

TANH.GIF

Command Summary

Calculates the hyperbolic tangent of a value.

Command Syntax

tanh(value)

Menu Location

The tanh( command is only found in the Catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. T to skip to commands starting with T.
  3. Scroll down and select tanh(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

Calculates the hyperbolic tangent of a value. The hyperbolic trig functions sinh(, cosh(, and tanh( are an analog of normal trig functions, but for a hyperbola, rather than a circle. They can be expressed in terms of real powers of e, and don't depend on the Degree or Radian mode setting.

tanh(0)
    0
tanh(1)
    .761594156

Like normal trig commands, tanh( works on lists as well, but not on complex numbers, even though the function is often extended to the complex numbers in mathematics.

Advanced Uses

The tanh( command can be used to approximate the sign function:

(1)
\begin{align} \operatorname{sgn} x=\begin{cases}-1&\text{if }x<0,\\0&\text{if }x=0,\\1&\text{if }x>0.\end{cases} \end{align}

As the absolute value of the input becomes large, the convergence is achieved at a point closer to zero. For the function to work as intended generally, numbers having lesser orders of magnitude need to be multiplied by a factor large enough for the argument to arrive at ±16.720082053122, which is the smallest input to produce ±1 (respectively) to fourteen digits of accuracy.

5/12→X
    .4166666667
tanh(E9X)
    1
tanh(-E9X)
    -1

Formulas

The definition of the hyperbolic tangent is:

(2)
\begin{align} \tanh{x}=\frac{e^x-e^{-x}}{e^x+e^{-x}}=\frac{e^{2x}-1}{e^{2x}+1} \end{align}

Related Commands

COSH.GIF

Command Summary

Calculates the hyperbolic cosine of a value.

Command Syntax

cosh(value)

Menu Location

The cosh( command is only found in the Catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. C to skip to commands starting with C.
  3. Scroll down and select cosh(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

Calculates the hyperbolic cosine of a value. The hyperbolic trig functions sinh(, cosh(, and tanh( are an analog of normal trig functions, but for a hyperbola, rather than a circle. They can be expressed in terms of real powers of e, and don't depend on the Degree or Radian mode setting.

cosh(0)
    1
cosh(1)
    1.543080635

Like normal trig commands, cosh( works on lists as well, but not on complex numbers, even though the function is often extended to the complex numbers in mathematics.

Formulas

The definition of hyperbolic cosine is:

(1)
\begin{align} \cosh{x}=\frac{e^x+e^{-x}}{2} \end{align}

Related Commands

SINH.GIF

Command Summary

Calculates the hyperbolic sine of a value.

Command Syntax

sinh(value)

Menu Location

The sinh( command is only found in the Catalog. Press:

  1. 2nd CATALOG to access the command catalog.
  2. S to skip to commands starting with S.
  3. Scroll down and select sinh(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

Calculates the hyperbolic sine of a value. The hyperbolic trig functions sinh(, cosh(, and tanh( are an analog of normal trig functions, but for a hyperbola, rather than a circle. They can be expressed in terms of real powers of e, and don't depend on the Degree or Radian mode setting.

sinh(0)
    0
sinh(1)
    1.175201194

Like normal trig commands, sinh( works on lists as well, but not on complex numbers, even though the function is often extended to the complex numbers in mathematics.

Formulas

The definition of hyperbolic sine is:

(1)
\begin{align} \sinh{x}=\frac{e^x-e^{-x}}{2} \end{align}

Related Commands

TANINVERSE.GIF

Command Summary

Returns the inverse tangent (also called arctangent)

Command Syntax

tanֿ¹(number)

Menu Location

Press:

  1. [2nd]
  2. [tanֿ¹]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

tanֿ¹( returns the arctangent of its argument. It is the inverse of tan(, which means that tanֿ¹(n) produces an angle θ such that tan(θ)=n.

Like tan(, the result of tanֿ¹( depends on whether the calculator is in Radian or Degree mode. However, unlike tangent, the result is in degrees or radians, not the argument. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion of θ=tanֿ¹(n) from radians to degrees is θ*180/π and from degrees to radians is θ*π/180. The tanֿ¹( command also works on a list.

tanֿ¹( will always return a value between -π/2 and π/2 (or -90° and 90°).

In radians:

:tanֿ¹(1)
    .7853981634

In degrees:
:tanֿ¹(1)
    45

Optimization

Expressions of the form tanֿ¹(y/x) are usually better recast as R►Pθ(x,y); the latter will not fail even if x should happen to be equal to zero.

Error Conditions

  • ERR:DATA TYPE is thrown if you input a complex value or a matrix.

Related Commands

NOT.GIF

Command Summary

Flips the truth value of its argument.

Command Syntax

not(value)

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. RIGHT to access the LOGIC submenu.
  3. 4 to select not(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The last logical operator available on the 83 series takes only one value as input. not( comes with its own parentheses to make up for this loss. Quite simply, it negates the input: False becomes True (1) and True returns False (0). not( can be nested; one use is to make any True value into a 1.

:not(0)
           1

:not(-20 and 14)

           0

:not(not(2))
           1

Advanced Uses

not(not(X)) will make any value X into 1 if it's not 0, and will keep it 0 if it is.

Optimization

not(X) and X=0 have the same truth value, but not( is shorter if the closing parenthesis is omitted:

:If A=0
can be
:If not(A

Related Commands

XOR.GIF

Command Summary

Returns the truth value of value1 or value2, but not both, being true.

Command Syntax

value1 xor value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. RIGHT to access the LOGIC submenu.
  3. 3 to select xor, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The third and final binary operator is a little trickier, but it has the coolest name. xor takes two numbers of expressions and checks to see if exactly one is True. If both are True or both are False, it returns 0.

1 xor 0
           1

:2 xor (3 xor 0)    (after evaluating 3 xor 0, it simplifies into True xor True.)
           0

:0 xor (1-1)^2
           0

Table of Results

For reference, the following true/false table shows what gets returned when you use different combinations of 1 (true) and 0 (false):

xor 1 (true) 0 (false)
1 (true) 0 (false) 1 (true)
0 (false) 1 (true) 0 (false)

Related Commands

OR.GIF

Command Summary

Returns the truth value of value1 or value2 being true.

Command Syntax

value1 or value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. RIGHT to access the LOGIC submenu.
  3. 2 to select or, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

or takes two numbers or expressions, and checks to see if either one is True. If both are False, it returns 0. If at least one is True, it returns 1. or is commutative (i.e. the order of arguments does not matter). As with and, you can use variables and expressions, and use multiple or's together.

:0 or 1-1
           0

:0 or -1
           1

:2 or 6*4
           1

:0 or 1 or 0
           1

Related Commands

AND.GIF

Command Summary

Returns the logical value of value1 and value2 being true.

Command Syntax

value1 and value2

Menu Location

Press:

  1. 2nd TEST to access the test menu.
  2. RIGHT to access the LOGIC submenu.
  3. ENTER to select and.

Calculator Compatibility

TI-83/84/+/SE/CSE/CE

Token Size

1 byte

and takes two numbers, variables, or expressions and tests to see if they are both True (not equal to 0). If they are, it returns 1. If either input is False (0), it returns 0. Note that the order of the operators doesn't matter (i.e. and is commutative), and that multiple and's can be used together

:0 and 0 
           0

:0 and 1
           0 

:1 and 2           (2 counts as True, just like one)
           1

:1→X
:X and 2+2         (you can use variables and expressions)
           1

:1 and 1 and 2-2   (the last input evaluates to 0, or false)
           0

Optimization

Multiplying two values has the same truth value as and; thus, and can sometimes be replaced by multiplication. Because the calculator does implicit multiplication, meaning it automatically recognises when you want to multiply, you don't need to use the * sign.

:If A and B
can be
:If AB

However, do not use this optimization if A and B might be expected to take on large values, as an overflow error might occur.

Related Commands

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

  • r (the radian symbol), used for converting an angle to radians.
  • Radian, the mode command for making radian angle measures the default.

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

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

  • ° (the degree symbol), used to convert an angle to degrees.
  • Degree, the mode command used to switch to degree mode.

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

The term "" is ambiguous and may refer to:

  • page1, a brief description
  • page2, another brief description

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

RADIAN.GIF

Command Summary

If the calculator is in degree mode, the r (radian) symbol converts a radian angle to degrees.

Command Syntax

angler

Menu Location

Press:

  1. 2nd ANGLE to access the angle menu.
  2. 3 to select r, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

NOTE: Due to the limitations of the wiki markup language, the r command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information.

Normally, when the calculator is in degree mode, the trigonometric functions only return values calculated in degrees. With the r symbol you can have the angle evaluated as if in radian mode because it converts the angle into degrees.

One full rotation around a circle is 2π radians, which is equal to 360°. To convert an angle in radians to degrees you multiply by 180/π, and to convert from degrees to radians multiply by π/180.

In degree mode:

sin(π)        \\sine of Pi degrees
    .0548036651
sin(π^^r)
    0

In radian mode:
sin(π)
    0
sin(π^^r)
    0        \\There's no difference when in radians

Optimization

When you only call the trig function once in a program and want it calculated in radians, instead of changing the mode you can just use ° to save one-byte (the newline from using the command Radian)

:Radian
:sin(X)
can be
:sin(X^^r)

Related Commands

  • ° (degree symbol)

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

  • real(, the complex number command returning the real part of a number.
  • Real, the mode command that selects Real number mode.

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

MODE.PNG FORMAT.PNG TBLSET.PNG

The TI-83 series of calculators has many options to select from that influence either the effect of commands or the way numbers or graphs are displayed. Outside a program, these can be changed by accessing the Mode, Format, or TblSet screens (shown above), and selecting the correct options. When editing a program, going to these screens and choosing an option will instead paste a command that sets that option for you.

These commands are given below, divided by the screen where it is found:

Mode Settings (MODE)

Graph Format Settings (2nd FORMAT)

  • RectGC and PolarGC determine how coordinates of the cursor are displayed and stored.
  • CoordOn and CoordOff determine whether the coordinates of the cursor are displayed at all.
  • GridOn and GridOff determine whether the grid is displayed.
  • AxesOn and AxesOff determine whether the X and Y axes are displayed.
  • LabelOn and LabelOff determine whether the X and Y axes are labeled (if they are displayed)
  • ExprOn and ExprOff determine whether the equation graphed or traced is displayed.
  • Time, Web, uvAxes, uwAxes, and vwAxes (visible in Seq mode) determine the way sequences are graphed, the default being Time.

Table Settings (2nd TBLSET)

  • IndpntAuto and IndpntAsk determine whether values of the independent variable in the table are calculated automatically.
  • DependAuto and DependAsk determine whether the values in the table are calculated automatically for all equations.

Miscellaneous Settings (2nd CATALOG)

Using these settings in a program

A fair amount of these settings are important to programmers because, if set to the wrong value, they can easily mess up the program. At the beginning of the program, therefore, it's a good idea to set these settings to the correct value. At the very minimum, programs that use the graph screen should set AxesOff if necessary, since AxesOn is the default and a very common setting. This is a part of program setup.

However, another important consideration is that it's somewhat rude to change the user's settings without permission, so your program should change as little as possible. How to reconcile these diametrically opposite goals? There are several ways that work for different settings:

Use GDBs (Graph DataBases)

The graph screen settings can be backed up in (and retrieved from) a GDB file by the StoreGDB and RecallGDB commands. If you store to a GDB at the beginning of the program, and recall from it at the end, you will have preserved all settings that deal with the graph screen.

Change math settings implicitly

Instead of changing settings like the Degree/Radian or the Real/a+bi setting, you can use certain commands that will force calculations to be done with that setting regardless of the mode. For example, you can use the degree symbol or radian symbol to make ambiguous calculations like sin(30) into unambiguous ones like sin(30o). Similarly, by adding 0i to a number, you force it to be complex, so that calculations done with it will never cause an ERR:NONREAL ANS (even if you're in Real mode).

Ignore uncommon settings

You might ignore settings that are too uncommon to matter. For example, setting the Full command is unnecessary, because very few people would ever use a split screen, and people that do probably will also figure out why your program breaks when they do so.

Be rude when you must

For something like Float, there's no way to avoid changing the user's settings in a way you can't restore. If you have to change a setting so your program works, do it, and mention the issue in the readme. If you changed a setting to an uncommon value, change it back to "Float" (in general, to the default value) when you're done.

TIMESROWPLUS.GIF

Command Summary

Adds a multiple of one row of a matrix to another.

Command Syntax

*row+(factor,matrix,row1,row2)

Menu Location

Press:

  1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu.
  2. RIGHT to access the MATH submenu.
  3. ALPHA F to select *row+(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The *row+( adds a multiple of one row to another row and returns the result. It is an elementary row operation used in Gaussian Elimination.

[[1,2][3,4]]
    [[1 2]
     [3 4]]
*row+(10,Ans,1,2)
    [[3  4 ]
     [31 42]]

Advanced Uses

You can add columns instead of rows with the aid of the T (transpose) command.

Error Conditions

  • ERR:INVALID DIM is thrown if one of the row arguments isn't a valid row (larger than the matrix size, or otherwise bad)

Related Commands

TIMESROW.GIF

Command Summary

Multiplies a row by a scalar.

Command Syntax

*row(factor,matrix,row)

Menu Location

Press:

  1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu.
  2. RIGHT to access the MATH submenu.
  3. ALPHA E to select *row(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The *row( command multiplies a row of a matrix by a scalar factor and returns the result. It is an elementary row operation used in Gaussian Elimination.

[[1,2][3,4]]
    [[1 2]
     [3 4]]
*row(10,Ans,1)
    [[10 20]
     [3  4 ]]

Advanced Uses

You can multiply columns instead of rows with the aid of the T (transpose) command.

Error Conditions

  • ERR:INVALID DIM is thrown if the row argument isn't a valid row (is larger than the size of the matrix, or otherwise bad)

Related Commands

ROWPLUS.GIF

Command Summary

Adds one row of a matrix to another.

Command Syntax

row+(matrix,row1,row2)

Menu Location

Press:

  1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu.
  2. RIGHT to access the MATH submenu.
  3. ALPHA D to select row+(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The row+( command adds one row of a matrix to the second, and returns the result. It is an elementary row operation used in Gaussian Elimination.

[[1,2][3,4]]
    [[1 2]
     [3 4]]
row+(Ans,1,2)
    [[1 2]
     [4 6]]

Advanced Uses

You can add columns instead of rows with the aid of the T (transpose) command.

Error Conditions

  • ERR:INVALID DIM is thrown if one of the row arguments isn't a valid row (larger than the matrix size, or otherwise bad)

Related Commands

ROWSWAP.GIF

Command Summary

Swaps two rows of a matrix.

Command Syntax

rowSwap(matrix,row1,row2)

Menu Location

Press:

  1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu.
  2. RIGHT to access the MATH submenu.
  3. ALPHA C to select rowSwap(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The rowSwap( command swaps two rows of a matrix and returns the result. It is an elementary row operation used in Gaussian Elimination.

[[1,2][3,4]]
    [[1 2]
     [3 4]]
rowSwap(Ans,1,2)
    [[3 4]
     [1 2]]

Advanced Uses

You can swap columns instead of rows with the aid of the T (transpose) command.

Error Conditions

  • ERR:INVALID DIM is thrown if one of the row arguments isn't a valid row (larger than the matrix size, or otherwise bad)

Related Commands

RECALLGDB.GIF

Command Summary

Recalls graph settings from a GDB (Graph DataBase) variable

Command Syntax

RecallGDB number

Menu Location

Press:

  1. 2nd DRAW to access the draw menu.
  2. LEFT to access the STO menu.
  3. 4 to select RecallGDB, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The RecallGDB command recalls graph settings a GDB (Graph DataBase) variable, one of GDB1, GDB2, …, GDB0 (as indicated by the argument). These settings can be stored to a GDB using the StoreGDB command.

The settings stored in a GDB include:

  • The graphing mode currently enabled.
  • All equations in the current graphing mode, but NOT other graphing modes.
  • All window variables applicable to the current graphing mode. This does not include zoom variables, table settings, or irrelevant variables such as Tmin when in function mode.
  • The menu settings relevant to graphing (everything in the 2nd FORMAT menu, as well as Connected/Dot and Sequential/Simul settings in the MODE menu)

The number passed to RecallGDB must be one of 0 through 9. It has to be a number: RecallGDB X will not work, even if X contains a value 0 through 9.

Advanced Uses

The StoreGDB and RecallGDB variables are useful in cleaning up after a program finishes running, preserving the user's settings. If your program heavily relies on the graph screen, it may end up editing window size or other graph settings, which the user might want to be saved. This is easily done:

Add StoreGDB 1 (or any other number) to the beginning of your program.

Then, feel free to edit any graph settings you like.

At the end of your program, add RecallGDB 1, followed by DelVar GDB1, to recall the graph settings stored at the beginning.

GDBs can also be useful in adding extra string storage. You can store strings to the Yn variables, and back them up in a GDB; to retrieve them later, recall the GDB and use Equ►String( to store the equations to the strings again.

Error Conditions

  • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9.
  • ERR:UNDEFINED is thrown if the requested GDB does not exist.

Related Commands

See Also

Routine Summary

Solves for the complex roots of a quadratic equation.

Inputs

A, B, C - the constants in Ax2+Bx+C=0

Outputs

Ans - a 2-element list of the two roots (or the one repeated root)

Variables Used

A, B, C

Calculator Compatibility

TI-83/84/+/SE

Author

thornahawk

URL: [http://tibasicdev.wikidot.com/local--files/quadratic-formula/Quad_Routines.zip]

Download

Quad_Routines.zip

-2C/(B+{-1,1}√(B²+4ACi²

For optimization purposes, an alternate form of the quadratic formula is used (see below for the formulas). The {-1,1} list is used to replace the ± symbol — lists can be used just as well as numbers in expressions, making the result a list as well. By using i² in the expression in place of subtraction, the routine avoids having to activate a+bi mode to allow complex roots.

The output is a complex list in Ans of the two roots. If there is only one root, it will be returned twice. If both roots are real, they will still be returned correctly, but stored internally as complex numbers — so use the real( command on them if you want to pass them to commands that don't accept complex arguments.

Advanced

The ordinary formula above can give poor results if B is much larger than A and/or C. In that case, an alternate routine can be used:

√(B²+4ACi²
If 0>real(Ansconj(B
-Ans
-.5(B+Ans
{Ans/A,C/Ans

Formulas

The ordinary quadratic formula, and its alternate form are used:

(1)
\begin{align} \mathrm{For} \hspace{5pt} ax^2+bx+c = 0, \\ \\ x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} \\ \\ x = \frac{2c}{-b\pm\sqrt{b^2-4ac}} \end{align}

Routine Summary

Performs a chi-square goodness-of-fit test, to determine if an observation fits a distribution.

The TI-84+ and TI-84+ SE have a command, χ²GOF-Test(, that does the same thing.

Inputs

L₁ - observed counts of the outcomes
L₂ - expected counts of their outcomes, or their distribution

Outputs

X - the χ² statistic for the data.
F - the df (degrees of freedom) statistic.
P - the probability value of the test.

Variables Used

L₁, L₂, X, F, P

Calculator Compatibility

TI-83/84/+/SE

Download

gof-test.zip

:L₂sum(L₁)/sum(L₂→L₂
:sum((L₁-L₂)²/L₂→X
:dim(L₁)-1→F
:χ²cdf(X,E99,F→P

This routine tests the null hypothesis that the variation between the observed and expected distributions is due to random chance alone. The value of P is the probability that such variation would occur, assuming the null hypothesis. You would reject this null hypothesis if this value is too low, and conclude that the variable you're measuring doesn't vary according to the expected distribution.

First, we must normalize L₂, the expected distribution, to have the same sum as L₁. We do this by multiplying by the sum of L₁, and dividing by the original sum of L₂. You can omit this line if L₂ already has the same sum, or optimize it to L₂sum(L₁→L₂ if it's a probability distribution (and hence has a sum of 1).

Then, we calculate the χ² statistic (according to the formula given at the bottom of the page). The number of degrees of freedom is just defined to be one less than the number of outcomes. Then, we calculate the probability that χ² would have a value this high by chance alone, by using the χ²cdf( command to calculate the probability mass between this value and infinity (we can't actually put in infinity, but we use the value E99, which is close enough for our purposes — the error introduced by this is too small for the calculator to evaluate).

An example: suppose you want to test if your six-sided die is fair. You threw the die 60 times, and recorded the results: a 1 came up 13 times, a 2 came up 10 times, a 3 came up 6 times, a 4 came up 9 times, a 5 came up 8 times, and a 6 came up 14 times. This is the observed frequency. The expected frequency is that the results would be even: each side would come up 10 times. Therefore, we set L₁ to {13,10,6,9,8,14} and L₂ to {10,10,10,10,10,10}.

The output is the following:

χ²=4.6
p=.4666162743
df=5

Because the value of p is high, it's perfectly plausible that the null hypothesis is true: p>0.05, so the data is not significant on a 5% level. We don't have enough evidence to reject the null hypothesis, so we conclude that the die is fair.

Formulas

The formula for calculating the χ² statistic: (Oi is the observed count of the ith outcome, and Ei is the expected count)

(1)
\begin{align} \chi_{n-1}^2 = \sum_{i=1}^n \frac{(O_i-E_i)^2}{E_i} \end{align}

Error Conditions

PTORX.GIF

Command Summary

P►Rx( calculates the x-value (in Cartesian coordinates) given Polar coordinates.

Command Syntax

P►Rx(r,θ)

Menu Location

Press:

  1. 2nd ANGLE to access the angle menu.
  2. 7 to select P►Rx(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE/CE

Token Size

1 byte

P►Rx( (polar►rectangular x-coordinate) calculates the x-coordinate of a polar point. Polar coordinates are of the form (r,θ), where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). The conversion identity x=r*cos(θ) is used to calculate P►Rx(.

The value returned depends on whether the calculator is in radian or degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The P►Rx( command also accepts a list of points.

P►Rx(5,π/4)
    3.535533906
5*cos(π/4)
    3.535533906
P►Rx({1,2},{π/4,π/3})
    {.7071067812 1}

Advanced Uses

You can bypass the mode setting by using the ° (degree) and r (radian) symbols. This next command will return the same values no matter if your calculator is in degrees or radians:

P►Rx(1,{π/4^^r,60°})
    {.7071067812 .5}

Optimization

In most cases P►Rx(r,θ) can be replaced by r*cos(θ) to save a byte:

:P►Rx(5,π/12)
can be
:5cos(π/12)

Conversely, complicated expressions multiplied by a cosine factor can be simplified by using P►Rx(r,θ) instead.

:(A+BX)cos(π/5)
can be
:P►Rx(A+BX,π/5)

Error Conditions

Related Commands

Polar is a graphing mode on TI-83 series calculators.

It may also refer to:

  • Polar, the mode command that enables Polar graphing mode.
  • ►Polar, the format command that displays complex numbers in polar form.
  • PolarGC, the mode command to store graph coordinates as (R,θ).

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

Although the wiki markup language provides a rich set of features and functionality for designing and laying out a page, one major limitation that it has is it does not allow formatting inside a link or code block. Specifically, you cannot display text or numbers as superscript (text is smaller and displayed at the top of the line) or subscript (text is smaller and displayed at the bottom of the line) respectively.

These particular command pages are the primary pages that this limitation impacts, and subsequently the commands are not able to be displayed like they would be on the calculator. Any page containing one or more of these commands will have a disclaimer, and links to more information on the individual commands affected.

Here is a listing of each command affected, along with how it will appear in this wiki, the command's proper name, and how to access it on a calculator:

Table of Contents

^^r

  • Radian Symbol
  • Appears as r on a calculator
  • To type, press:
    1. [2nd]
    2. [Angle]
    3. [2] or use arrows to select r

T

  • Transpose
  • Appears as T on a calculator
  • To type, press:
    1. [2nd]
    2. [Matrix]
    3. [Right] to access MATH submenu
    4. [2] or use arrow keys to select T

E

  • Base 10 exponent symbol
  • Appears as E on a calculator
  • To type, press:
    1. [2nd]
    2. [EE]

Related Pages

DEGREE%20(SYMBOL).GIF

Command Summary

If the calculator is in radian mode, the ° (degree) symbol converts an angle to radians.

Command Syntax

angle°

Menu Location

Press:

  1. [2nd]
  2. [Angle]
  3. [Enter] or [1]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

Normally, when the calculator is in radian mode, the trigonometric functions only return values calculated in radians. With the ° symbol you can have the angle evaluated as if in degree mode because it converts the angle into radians.

One full rotation around a circle is 2π radians, which is equal to 360°. To convert an angle in radians to degrees you multiply by 180/π, and to convert from degrees to radians multiply by π/180.

In radian mode:

sin(45)        \\ actually calculating sin(2578.31)
    .8509035245
sin(45°)
    .7071067812

In degree mode:
sin(45)
    .7071067812
sin(45°)
    .7071067812    \\ There's no difference when in degrees

Optimization

When you only call the trig function once in a program and want it calculated in degrees, instead of changing the mode you can just use ° to save one-byte (the newline from using the command Degree)

:Degree
:sin(X)
can be
:sin(X°)

Related Commands

  • r (radian symbol)
COSINVERSE.GIF

Command Summary

Returns the inverse cosine (also called arccosine)

Command Syntax

cosֿ¹(number)

Menu Location

Press:

  1. [2nd]
  2. [cosֿ¹]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

cosֿ¹( returns the arccosine of its argument. It is the inverse of cos(, which means that cosֿ¹(n) produces an angle θ such that cos(θ)=n.

Like cos(, the result of cosֿ¹( depends on whether the calculator is in Radian or Degree mode. However, unlike cosine, the result is in degrees or radians, not the argument. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion of θ=cosֿ¹(n) from radians to degrees is θ*180/π and from degrees to radians is θ*π/180. The cosֿ¹( command also works on a list.

The cosֿ¹( function can be defined for all real and complex numbers, but assumes real values only in the closed interval [-1,1]. Because Z80 calculators have their trigonometric functions and inverses restricted only to real values, the calculator will throw ERR:DOMAIN if the argument is outside of this interval, no matter what the mode setting may be.

In radians:

:cosֿ¹(-1)
    3.141592654

In degrees:
:cosֿ¹(-1)
    180

Advanced Uses

Since the function cosine itself doesn't have the restrictions that arccosine does, and since arccosine is the inverse of cosine, you can use cosֿ¹(cos( to keep a variable within a certain range (most useful for the home screen). Here is an example for a game like pong. The ball travels between 0 and 12.

You could use a flag like this:

:If X=12 or not(X     \\ X is the position
:-D→D        \\ D is the direction
:X+D→X        \\ new position
:Output(8,X,"=

An easier way to do this, without needing a flag or even an If statement, is using cosֿ¹(cos(

:X+1→X        \\ Note: the calculator is in Degree mode
:Output(8,cosֿ¹(cos(15X))/15,"=")    \\ I used 15 because cosֿ¹ ranges from [0,180]
                                        and X from [0,12],  so 180/12=15

Error Conditions

  • ERR:DOMAIN is thrown if you supplied an argument outside the interval [-1,1]
  • ERR:DATA TYPE is thrown if you input a complex value or a matrix.

Related Commands

SININVERSE.GIF

Command Summary

Returns the inverse sine (also called arcsine)

Command Syntax

sinֿ¹(number)

Menu Location

Press:

  1. [2nd]
  2. [sinֿ¹]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

sinֿ¹( returns the arcsine of its argument. It is the inverse of sin(, which means that sinֿ¹(z) produces an angle θ such that sin(θ)=z.

Like sin(, the result of sinֿ¹( depends on whether the calculator is in Radian or Degree mode. However, unlike sine, the result is in degrees or radians, not the argument. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion of θ=sinֿ¹(n) from radians to degrees is θ*180/π and from degrees to radians is θ*π/180. The sinֿ¹( command also works on lists.

The sinֿ¹( function can be defined for all real and complex numbers; however, the function assumes real values only in the closed interval [-1,1]. Because the trigonometric functions and their inverses in the Z80 calculators are restricted only to real values, the calculator will throw ERR:DOMAIN if the argument is outside of this interval, no matter what the mode setting may be.

In radians:

:sinֿ¹(1)
    1.570796327

In degrees:
:sinֿ¹(1)
    90

Advanced Uses

Since the function sine itself doesn't have the restrictions that arcsine does, and since arcsine is the inverse of sine, you can use sinֿ¹(sin( to keep a variable within a certain range (most useful on the graph screen). Here is an example for a game like pong. The ball travels between -6 and 6.

You could use a flag like this:

:If 6=abs(X        \\ X is the position
:-D→D        \\ D is the direction
:X+D→X        \\ new position
:Pt-On(-54,X,"=")

An easier way to do this, without needing a flag or even an If statement, is using sinֿ¹(sin(

:X+1→X        \\ Note: the calculator is in degree mode
:Pt-On(-54,sinֿ¹(sin(15X))/15,"=")    \\ 15 is used because sinֿ¹ ranges from [-90,90]
                                        and X from [-6,6],  so 90/6=15

Error Conditions

  • ERR:DATA TYPE is thrown if you input a complex value or a matrix.
  • ERR:DOMAIN is thrown if you supplied an argument outside the interval [-1,1]

Related Commands

TAN.GIF

Command Summary

Returns the tangent of a real number.

Command Syntax

tan(angle)

Menu Location

Press TAN

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

tan(θ) calculates the tangent of the angle θ, which is defined by $\tan \theta=\frac{\sin \theta}{\cos \theta}$

The value returned depends on whether the calculator is in Radian or Degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The tan( command also works on a list of real numbers.

Since tangent is defined as the quotient of sine divided by cosine, it is undefined for any angle such that cos(θ)=0.

In radians:

tan(π/4)
    1

In degrees:

tan(45)
    1

Advanced Uses

You can bypass the mode setting by using the ° (degree) and r (radian) symbols. These next two commands will return the same values no matter if your calculator is in degrees or radians:

tan(45°)
    1
tan(π/4¹ )
    1

Error Conditions

  • ERR:DATA TYPE is thrown if you supply a matrix or a complex argument.
  • ERR:DOMAIN is thrown if you supply an angle of π/2±nπ (in radians, where n is an integer) or 90±180n (in degrees, where n is an integer), or when the input is ≥1E12.

Related Commands

COS.GIF

Command Summary

Returns the cosine of a real number.

Command Syntax

cos(angle)

Menu Location

Press [COS]

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

cos(θ) returns the cosine of θ, which is defined as the x-value of the point of intersection of the unit circle and a line containing the origin that makes an angle θ with the positive x-axis

The value returned depends on whether the calculator is in Radian or Degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The cos( command also works on a list of real numbers.

In radians:

cos(π/3)
    .5

In degrees:

cos(60)
    .5

Advanced Uses

You can bypass the mode setting by using the ° (degree) and r (radian) symbols. These next two commands will return the same values no matter if your calculator is in degrees or radians:

cos(60°)
    .5
cos(π/3ֿ¹ )
    .5

Error Conditions

  • ERR:DATA TYPE is thrown if you supply a matrix or a complex argument.
  • ERR:ARGUMENT is thrown if you use more than one number.
  • ERR:DOMAIN is thrown if you supply an input ≥1E12.

Related Commands

See Also

SIN.GIF

Command Summary

Returns the sine of a real number.

Command Syntax

sin(angle)

Menu Location

Press the SIN key to paste sin(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

NOTE: Due to the limitations of the wiki markup language, the r command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information.

sin(θ) returns the sine of θ, which is defined as the y-value of the point of intersection of the unit circle and a line containing the origin that makes an angle θ with the positive x-axis

The value returned depends on whether the calculator is in Radian or Degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The sin( command also works on a list of real numbers.

In radians:

sin(π/6)
    .5

In degrees:

sin(30)
    .5

Advanced Uses

You can bypass the mode setting by using the ° (degree) and r (radian) symbols. These next two commands will return the same values no matter if your calculator is in degrees or radians:

sin(30°)
    .5
sin(π/6ֿ¹)
    .5

Error Conditions

  • ERR:DATA TYPE is thrown if you supply a matrix or a complex argument.
  • ERR:DOMAIN is thrown if you supply an input ≥1E12.

Related Commands

See Also

STOREGDB.GIF

Command Summary

Stores graph setting to a GDB (Graph DataBase) to be recalled later with RecallGDB.

Command Syntax

StoreGDB GDB#
StoreGDB number

Menu Location

Press:

  1. 2nd DRAW to access the draw menu.
  2. LEFT to access the STO menu.
  3. 3 to select StoreGDB, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE/CSE/CE

Token Size

1 byte

The StoreGDB command stores all graph settings needed to reconstruct the current graph to a GDB (Graph DataBase) variable, one of GDB1, GDB2, …, GDB0 (as indicated by the argument). These settings can then be recalled using the RecallGDB command.

The settings stored in a GDB include:

  • The graphing mode currently enabled.
  • All equations in the current graphing mode, but NOT other graphing modes.
  • All window variables applicable to the current graphing mode. This does not include zoom variables, table settings, or irrelevant variables such as Tmin when in function mode.
  • The menu settings relevant to graphing (everything in the 2nd FORMAT menu, as well as Connected/Dot and Sequential/Simul settings in the MODE menu)

The number passed to StoreGDB must be one of 0 through 9. It has to be a number: StoreGDB X will not work, even if X contains a value 0 through 9.

Advanced Uses

The StoreGDB and RecallGDB variables are useful in cleaning up after a program finishes running, preserving the user's settings. If your program heavily relies on the graph screen, it may end up editing window size or other graph settings, which the user might want to be saved. This is easily done:

Add StoreGDB 1 (or any other number) to the beginning of your program.

Then, feel free to edit any graph settings you like.

At the end of your program, add RecallGDB 1, followed by DelVar GDB1, to recall the graph settings stored at the beginning.

GDBs can also be useful in adding extra string storage. You can store strings to the Yn variables, and back them up in a GDB; to retrieve them later, recall the GDB and use Equ►String( to store the equations to the strings again.

Error Conditions

  • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9.

Related Commands

See Also

STOREPIC.GIF

Command Summary

Stores the graph screen to a picture (one of Pic1, Pic2, …, Pic0)

Command Syntax

StorePic number

Menu Location

Press:

  1. 2nd DRAW to access the draw menu.
  2. LEFT to access the STO submenu.
  3. ENTER to select StorePic

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

StorePic saves the graph screen to a picture (to recall it later, use RecallPic). Every detail of the graph screen will be stored as it appears, with the sole exception of X and Y labels on the axes (if they are shown).

The number passed to StorePic must be one of 0 through 9. It has to be a number: StorePic X will not work, even if X contains a value 0 through 9.

Advanced Uses

A combination of StorePic and RecallPic can be used to maintain a background over which another sprite moves:

First, draw the background, and save it to a picture file with StorePic.
Next, draw the sprite to the screen.
When you want to move the sprite, erase it, then use RecallPic to draw the background again.
Then draw the sprite to its new location on the screen again (this can be done before or after using RecallPic).

Also, if a screen in your program takes more than a second to draw, and is displayed several times, you might want to consider storing it to a picture the first time it's drawn, and then recalling it every next time you want to draw it.

Error Conditions

  • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9.

Related Commands

RECALLPIC.GIF

Command Summary

Recalls a saved picture (one of Pic1, Pic2, …, Pic0) to the graph screen.

Command Syntax

RecallPic number

Menu Location

Press:

  1. 2nd DRAW to access the draw menu.
  2. LEFT to access the STO submenu.
  3. 2 to select RecallPic, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

RecallPic draws a saved picture to the graph screen (to save a picture, draw it on the graph screen, then save it with StorePic). If something is already drawn on the graph screen, RecallPic will draw new pixels where needed, but it will not erase anything. As a result, you often want to ClrDraw before recalling a picture.

The number passed to RecallPic must be one of 0 through 9. It has to be a number: RecallPic X will not work, even if X contains a value 0 through 9.

Advanced Uses

A combination of StorePic and RecallPic can be used to maintain a background over which another sprite moves:

  1. Draw the background, and save it to a picture file with StorePic.
  2. Next, draw the sprite to the screen.
  3. When you want to move the sprite, erase it, then use RecallPic to draw the background again.
  4. Then draw the sprite to its new location on the screen again (this can be done before or after using RecallPic).

Also, if a screen in your program takes more than a second to draw, and is displayed several times, you might want to consider storing it to a picture the first time it's drawn, and then recalling it every next time you want to draw it.

Error Conditions

  • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9.
  • ERR:UNDEFINED is thrown if the requested picture does not exist.

Related Commands

RREF.GIF

Command Summary

Puts a matrix into reduced row-echelon form.

Command Syntax

rref(matrix)

Menu Location

Press:

  1. MATRX (on the TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu.
  2. RIGHT to access the math menu.
  3. ALPHA B to select rref(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

Given a matrix with at least as many columns as rows, the rref( command puts a matrix into reduced row-echelon form using Gaussian elimination.

This means that as many columns of the result as possible will contain a pivot entry of 1, with all entries in the same column, or to the left of the pivot, being 0.

[[1,2,5,0][2,2,1,2][3,4,6,2]]
    [[1 2 5 0]
     [2 2 1 2]
     [3 4 7 3]]
rref(Ans)
    [[1 0 0 6   ]
     [0 1 0 -5.5]
     [0 0 1 1   ]]

Advanced Uses

The rref( command can be used to solve a system of linear equations. First, take each equation, in the standard form of $a_1x_1+\dots + a_nx_n = b$, and put the coefficients into a row of the matrix.

Then, use rref( on the matrix. There are three possibilities now:

  • If the system is solvable, the left part of the result will look like the identity matrix. Then, the final column of the matrix will contain the values of the variables.
  • If the system is inconsistent, and has no solution, then it will end with rows that are all 0 except for the last entry.
  • If the system has infinitely many solutions, it will end with rows that are all 0, including the last entry.

This process can be done by a program fairly easily. However, unless you're certain that the system will always have a unique solution, you should check that the result is in the correct form, before taking the values in the last column as your solution. The Matr►list( command can be used to store this column to a list.

Error Conditions

Related Commands

REF.GIF

Command Summary

Puts a matrix into row-echelon form.

Command Syntax

ref(matrix)

Menu Location

Press:

  1. MATRX (on the TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu.
  2. RIGHT to access the MATH submenu.
  3. ALPHA A to select ref(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

Given a matrix with at least as many columns as it has rows, the ref( command uses a technique called Gaussian elimination to put the matrix into row-echelon form.

This means that the leftmost N columns (if the matrix has N rows) of the matrix are upper triangular - all entries below the main diagonal are zero. What's more, every entry on the main diagonal is either 0 or 1.

[[1,2,5,0][2,2,1,2][3,4,6,2]]
    [[1 2 5 0]
     [2 2 1 2]
     [3 4 6 2]
ref(Ans)►Frac
    [[1 4/3 2   2/3]
     [0 1   9/2 -1 ]
     [0 0   0   0  ]]

Advanced Uses

In theory, a system of linear equations in N variables can be solved using the ref( command - an equation of the form $a_1x_1+\dots + a_nx_n = b$ becomes a row $a_1, \dots, a_n, b$, and is put into the matrix. If there is a sufficient number of conditions, the last row of the reduced matrix will give you the value of the last variable, and back-substitution will give you the others.

In practice, it's easier to use rref( instead for the same purpose.

Error Conditions

Related Commands

Routine Summary

Converts a string to a list of numbers.

Inputs

Str1 - The string you want to convert

Outputs

L₁ - The list that the numbers are stored to

Variables Used

L₁, A, Str1

Calculator Compatibility

TI-83/84/+/SE

Download

stringtolist.zip

:1+seq(inString("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ",sub(Str1,A,1)),A,1,length(Str1→L₁

With our characters stored in Str1, we loop through each character and store its position in our reference string (the uppercase alphabet) to the respective element of L₁.

This routine only allows for values from 1 to 26 in the list, since our string of characters is the uppercase alphabet, and each list value must match up to one of the string positions. If you add more characters to the string, however, you can increase the range of values in the list. This routine uses Str1, so you should clean it up at the end of your program.

Advanced Routine

Since a list element can store up to 14 digits, you can use int(, fPart(, and exponents to compress an additional 7 letters per element (2 digits for each letter), thus increasing your total number of characters to 6993.

" ABCDEFGHIJKLMNOPQRSTUVWXYZ->Str0
DelVar L1
For(A,0,dim(L1
0
For(B,1,min(7,length(Str1)-7A
Ans+.1^(2B)inString(Str0,sub(Str1,B+7A,1
End
Ans->L1(A+1
End
"

Related Routines

Routine Summary

Converts a matrix to a string.

Inputs

[A] - The matrix you want to convert

Outputs

Str1 - The string that the text is stored to

Variables Used

[A], L₁, A, B, Ans, Str1

Calculator Compatibility

TI-83/84/+/SE

Download

matrixtostring.zip

Note: If you have a TI-84+ CE with OS 5.2 or higher, you can ignore this entire routine and just use the toString( command.

:dim([A]→L₁:"?
:For(A,1,L₁(1
:For(B,1,L₁(2
:Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",[A](A,B),1
:End:End
:sub(Ans,2,length(Ans)-1→Str1

With our values stored in [A], we get the dimensions (row x column) of the matrix, which are stored in a list. We then loop through each row and column, and store the character at the respective element to our string that is at the matching position in our substring. In order to construct a string with all of the characters from [A], we first need to create a dummy string. This is what the "? is used for.

Each time through the For( loops, we concatenate the string from before (which is still stored in the Ans variable) to the next character that is found in the matrix. Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable.

By the time we are done with the For( loops, all of our characters are put together in Ans. However, because we stored the dummy character as the first character at the beginning of the string, we now need to remove it, which we do by simply getting the substring from the second character to the end of the string. Finally, we store the string to a more permanent variable (in this case, Str1) for future use.

This routine only allows for values from 1 to 26 in the matrix, since our string of characters is the uppercase alphabet, and each matrix value must match up to one of the string positions. If you add more characters to the string, however, you can increase the range of values in the matrix. This routine uses [A] and L₁, so you should clean them up at the end of your program.

Related Routines

PLOTSOFF.GIF

Command Summary

Turns stat plots (all of them, or only those specified) off.

Command Syntax

PlotsOff numbers//

Menu Location

Press:

  1. 2nd PLOT to access the stat plot menu.
  2. 4 to select PlotsOff, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

By itself, the command will turn off all three stat plots.

If it is given arguments, there can be any number of them (actually, no more than 255, but this won't stop most people), but they must all be numbers 1 to 3. Then, the command will only turn off the specified plots. Unlike some commands, it is okay to give PlotsOff an expression as an argument (for example, PlotsOff X), as long as it has a value of 1, 2, or 3.

Error Conditions

  • ERR:DOMAIN is thrown if a plot that is not 1, 2, or 3 is specified.

Related Commands

PLOTSON.GIF

Command Summary

Turns stat plots (all of them, or only those specified) on.

Command Syntax

PlotsOn numbers//

Menu Location

Press:

  1. 2nd PLOT to access the stat plot menu.
  2. 5 to select PlotsOn, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

By itself, the command will turn on all three stat plots.

If it is given arguments, there can be any number of them (actually, no more than 255, but this won't stop most people), but they must all be numbers 1 to 3. Then, the command will only turn on the specified plots. Unlike some commands, it is okay to give PlotsOn an expression as an argument (for example, PlotsOn X), as long as it has a value of 1, 2, or 3.

Error Conditions

  • ERR:DOMAIN is thrown if a plot that is not 1, 2, or 3 is specified.

Related Commands

PLOTN.GIF

Command Summary

Displays a statistical plot of one of six types.

Command Syntax

Plot#(type,…

The syntax varies based on the type of plot:

Plot#(Scatter, x-list, y-list, mark, [color#])

Plot#(xyLine, x-list, y-list, mark, [color#])

Plot#(Histogram, x-list, freq list, [color#])

Plot#(Boxplot, x-list, freq list, [color#])

Plot#(ModBoxplot, x-list, freq list, mark, [color#])

Plot#(NormProbPlot, data list, data axis, mark, [color#])

Menu Location

While editing a program, press:

  1. 2nd PLOT to access the stat plot menu.
  2. 1, 2, or 3 (or use arrows) to select Plot1(, Plot2(, Plot3( respectively.

(outside a program, this brings you to the plot editor screen)

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The commands Plot1(, Plot2(, and Plot3(, which are identical except for which stat plot (1, 2, or 3) they affect, define their corresponding stat plot. When the stat plot is defined, it is also turned on so no PlotsOn command is necessary.

The first argument of the commands is always the type of plot, and is one of Scatter, xyLine, Histogram, Boxplot, ModBoxplot, and NormProbPlot - these types are found in the TYPE submenu of the stat plot menu. The other arguments vary. For all but Histogram and Boxplot, there is a mark argument - this is a dot, a cross, or a box, symbols that can be found in the MARK submenu of the stat plot menu. On color calculators, there is an optional final argument to specify the color of the plot.

Scatter plot

Plot#(Scatter, x-list, y-list, mark) defines a scatter plot. The points defined by x-list and y-list are plotted using mark on the graph screen.

x-list and y-list must be the same length.

xyLine plot

Plot#(xyLine, x-list, y-list, mark) defines an xyLine plot. Similarly to a scatter plot, the points defined by x-list and y-list are plotted using mark on the graph screen, but with an xyLine plot they are also connected by a line, in the order that they occur in the lists.

x-list and y-list must be the same length.

Histogram plot

Plot#(Histogram, x-list, freq list) defines a Histogram plot. The x-axis is divided into intervals that are Xscl wide. A bar is drawn in in each interval whose height corresponds to the number of points in the interval. Points that are not between Xmin and Xmax are not tallied.

Xscl must not be too small - it can divide the screen into no more than 47 different bars.

Box plot

Plot#(Boxplot, x-list, freq list) defines a box plot. A rectangular box is drawn whose left edge is Q1 (the first quartile) of the data, and whose right edge is Q3 (the third quartile). A vertical segment is drawn within the box at the median, and 'whiskers' are drawn from the box to the minimum and maximum data points.

The box plot ignores the Ymax and Ymin dimensions of the screen, and any plots that aren't box plots or modified box plots. Each box plot takes approximately 1/3 of the screen in height, and if more than one are plotted, they will take up different areas of the screen.

Modified box plot

Plot#(ModBoxplot, x-list, freq list, mark) defines a modified box plot. This is almost entirely like the normal box plot, except that it also draws outliers. Whiskers are only drawn to the furthers point within 1.5 times the interquartile range (Q3-Q1) of the box. Beyond this point, data points are drawn individually, using mark.

The box plot ignores the Ymax and Ymin dimensions of the screen, and any plots that aren't box plots or modified box plots. Each box plot takes approximately 1/3 of the screen in height, and if more than one are plotted, they will take up different areas of the screen.

Normal probability plot

Plot#(NormProbPlot, data list, data axis, mark) defines a normal probability plot. The mean and standard deviation of the data are calculated. Then for each point, the number of standard deviations it is from the mean is calculated, and the point is plotted against this number using mark. data axis can be either X or Y: it determines whether the value of a point determines it's x-coordinate or y-coordinate.

The point behind this rather convoluted process is to test the extent to which the data is normally distributed. If it follows the normal distribution closely, then the result will be close to a straight line - otherwise it will be curved.

Advanced Uses

After doing a regression, a scatter plot of ∟RESID against the x-list is a useful measure of the effectiveness of the regression. If the plot appears random, this is a good sign; if there is a pattern to the plot, this means it's likely that a better regression model exists.

Optimization

The ∟ symbol at the beginning of list names can be omitted everywhere in this command.

In addition, every element except the plot type and the data list or data lists are optional, and take on the following default values:

  • freq list is 1 by default, meaning that all frequencies are 1.
  • mark is the box by default.
  • data axis is X by default.

Error Conditions

  • ERR:DIM MISMATCH is thrown if the x and y lists, or the data and frequency lists, have different dimensions.
  • ERR:STAT is thrown if Xscl is too small in the case of a Histogram.

All errors are thrown when plotting the stat plot, as opposed to when the command is executed, and do not provide a 2:Goto option.

Related Commands

SELECT.GIF

Command Summary

Allows the user to select a subinterval of any enabled Scatter or xyLine plots.

Command Syntax

Select(x-list name, y-list name)

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. RIGHT to access the OPS submenu.
  3. 8 to select Select(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

When Select( is called, if it has any Scatter or xyLine plots to work with, it displays the graph screen and allows the user to pick a left bound and then a right bound on one of the plots (the left and right keys move from point to point, while the up and down keys switch plots). Then, it stores all the points between those bounds to x-list name and y-list name. Finally, it sets the chosen plot to use x-list name and y-list name as its X and Y lists.

Optimization

It isn't necessary to add the ∟ symbol before list names:

:Select(∟X,∟Y)
can be
:Select(X,Y)

Error Conditions

  • ERR:INVALID is thrown if there are no enabled Scatter or xyLine plots for the command to work with.

Related Commands

PROD.GIF

Command Summary

Calculates the product of all or part of a list.

Command Syntax

prod(list[,start,[end]])

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. LEFT to access the MATH submenu.
  3. 6 to select prod(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The prod( command calculates the product of all or part of a list.

When you use it with only one argument, the list, it multiplies all the elements of the list. You can also give it a bound of start and end and it will only multiply the elements starting and ending at those indices (inclusive).

prod({1,2,3,4,5})
    120
prod({1,2,3,4,5},2,4)
    24
prod({1,2,3,4,5},3)
    60

Optimization

If the value of end is the last element of the list, it can be omitted:

prod({1,2,3,4,5},3,5)
can be
prod({1,2,3,4,5},3)

Error Conditions

  • ERR:DOMAIN if the starting or ending value aren't positive integers.
  • ERR:INVALID DIM if the starting or ending value exceed the size of the list, or are in the wrong order.

Related Commands

SORTD.GIF

Command Summary

Sorts a list in descending order.

For more than one list, sorts the first, and reorders other lists accordingly.

Command Syntax

SortD(list1 [,list2, …])

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. RIGHT to access the OPS submenu.
  3. 2 to select SortD(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The SortD( command sorts a list in descending order. It does not return it, but instead edits the original list variable (so it takes only list variables as arguments).

SortD( can also be passed multiple lists. In this case, it will sort the first list, and reorder the others so that elements which had the same indices initially will continue having the same indices. For example, suppose the X and Y coordinates of some points were stored in ∟X and ∟Y, so that the Nth point had coordinates ∟X(N) and ∟Y(N). Then SortD(∟X,∟Y) would sort the points by their x-coordinates, still preserving the same points.

However, SortD( is not stable: if several elements in the first list are equal, then the corresponding elements in the subsequent lists may still end up being in a different order than they were initially.

Algorithm

The algorithm used by SortD( and SortA( appears to be a modified selection sort. It is still O(n2) on all inputs, but for some reason takes twice as long on a list with all equal elements. It is not stable.

Related Commands

SORTA.GIF

Command Summary

Sorts a list in ascending order.

For more than one list, sorts the first, and reorders other lists accordingly.

Command Syntax

SortA(list1 [,list2, …])

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. RIGHT to access the OPS submenu.
  3. ENTER to select SortA(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The SortA( command sorts a list in ascending order. It does not return it, but instead edits the original list variable (so it takes only list variables as arguments).

SortA( can also be passed multiple lists. In this case, it will sort the first list, and reorder the others so that elements which had the same indices initially will continue having the same indices. For example, suppose the X and Y coordinates of some points were stored in ∟X and ∟Y, so that the Nth point had coordinates ∟X(N) and ∟Y(N). Then SortA(∟X,∟Y) would sort the points by their x-coordinates, still preserving the same points.

However, SortA( is not stable: if several elements in the first list are equal, then the corresponding elements in the subsequent lists may still end up being in a different order than they were initially.

Algorithm

The algorithm used by SortA( and SortD( appears to be a modified selection sort. It is still O(n2) on all inputs, but for some reason takes twice as long on a list with all equal elements. It is not stable.

Related Commands

SUM.GIF

Command Summary

Calculates the sum of all or part of a list.

Command Syntax

sum(list[,start,[end]])

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. LEFT to access the MATH submenu.
  3. 5 to select sum(, or use arrows and ENTER.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The sum( command calculates the sum of all or part of a list.

When you use it with only one argument, the list, it sums up all the elements of the list. You can also give it a bound of start and end and it will only sum up the elements starting and ending at those indices (inclusive).

sum({1,2,3,4,5})
    15
sum({1,2,3,4,5},2,4)
    9
sum({1,2,3,4,5},3)
    12

Optimization

If the value of end is the last element of the list, it can be omitted:

sum({1,2,3,4,5},3,5)
can be
sum({1,2,3,4,5},3)

Error Conditions

  • ERR:DOMAIN is thrown if the starting or ending value aren't positive integers.
  • ERR:INVALID DIM is thrown if the starting or ending value exceed the size of the list, or are in the wrong order.

Related Commands

RANDM.GIF

Command Summary

Creates a matrix of specified size with the entries random integers from -9 to 9.

Command Syntax

randM(# rows, # columns)

Menu Location

Press:

  1. MATRX (TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu
  2. RIGHT to access the MATH submenu.
  3. 6 to select randM(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

randM(M, N) generates an M by N matrix whose entries are pseudorandom integers between -9 and 9 inclusive.

seed→rand affects the output of randM(.

0→rand
    0
randM(3,3)
    [[9  -3 -9]
     [4  -2 0 ]
     [-7 8  8 ]]

If you actually cared about the bounds of the random numbers, this command would not be very useful, since it's hard to manipulate the matrix to yield uniformly spread random numbers in a different range.

Formulas

The entries of randM( are actually the outputs of successive calls to randInt(-9,9), filled in starting at the bottom right and moving left across each row from the last row to the first.

Error Conditions

  • ERR:INVALID DIM is thrown if the number of rows or columns of the matrix isn't an integer 1-99.

Related Commands

A friendly graphing window is some configuration of window variables that's most useful for your program — most commonly, because it makes the coordinate value of a pixel come out to a round value, such as an integer, or .1 of an integer.

Setting up a square window

The most basic type of friendly window is one in which a vertical distance in pixels is equal, coordinate-wise, to the same horizontal distance in pixels. This means that the ratio between (Xmax-Xmin) and (Ymax-Ymin) is 47:31. Such a setup has the useful effect that drawing a circle (for example, with the Circle( command) actually results in a circle, and not an ellipse.

This can be accomplished simply with the ZSquare command, which will alter the values of the screen so that:

  • the coordinate of the center remains the same
  • the ratio (Xmax-Xmin) : (Ymax-Ymin) is 47:31 (approximately 1.516 : 1)
  • the resulting window is larger rather than smaller than the original.

A common technique is to run the ZStandard command first, so that the center of the screen is at (0,0).

Setting up an integer square window

However, it's possible to take friendliness even further, by adding the condition that coordinate values of a pixel come out to round values without long decimals. This can be done in several ways:

Using the ZDecimal command

This is by far the simplest — the ZDecimal command will set Xmin to -4.7, Xmax to 4.7, Ymin to -3.1, and Ymax to 3.1. As you can see, this satisfies the condition for a square window. Also, the coordinates of pixels have at most one decimal place: pixels that are next to each other differ by 0.1 in the appropriate coordinate.

Zdecimal is useful if you only need to do a few point/line commands, like if you were drawing a border around the screen using Horizontal and Vertical.

However, it has the drawback of still having a decimal point. Your drawing commands may look like Line(-3.1, -1.7, 3.1, -1.7) — if you didn't have to have that decimal point there, you'd save a considerable amount of space. This is possible, using the following three methods:

An integer window with (0,0) in the center

These methods are basically divided over where the point (0,0) should be. Putting it in the center ensures that drawing things in the middle of the screen takes up little space; also, you can achieve symmetry easily by appropriately negating numbers. On the other hand, the negative sign (you'll be using one 3/4 of the time, and 1/4 of the time you'll need two) can be annoying.

The following code sets up an integer square window with (0,0) in the center:

:ZStandard
:ZInteger
An integer window with (0,0) in the bottom left corner

This approach is optimal in terms of saving space on coordinates: they are all positive numbers with at most two digits. For this reason, it is the most widely used. The following code sets up such a window:

:ZStandard
:84→Xmin
:72→Ymax
:ZInteger
An integer window with (0,0) in the top left corner

This approach is useful for when point and pixel commands need to be used together. Although putting (0,0) in the top left makes every Y-coordinate negative, the window has the useful property that it's very easy to go from point commands to pixel commands: the pixel (R,C) corresponds to the point (C,-R), and equivalently, the point (X,Y) corresponds to the pixel (-Y,X). It's somewhat trickier to set up, though:

:ZStandard
:84→Xmin
:-72→Ymin
:ZInteger

Why friendly windows are useful

Throughout this article, we've only made glancing comments as to why you'd want to use friendly windows. Here is a more exhaustive explanation:

Graphs come out nicer

Even with a square window, graphs become more accurate, because they reflect the actual proportions of the equation being graphed. For example, try drawing a circle in the standard graphing window — you'll get some stretched out oval. Now ZSquare and try again. The result is much better, right?

With an integer square window, certain other imperfections of the calculator's graphing go away. For example, try graphing Y=1/(X+1) in the standard graphing window. Pretty accurate, but instead of the asymptote there's a slightly diagonal line. That's because the asymptote doesn't end up corresponding to a pixel of the graph: one pixel, the curve is a very negative number, the next it's a very positive number, so the calculator tries to connect them.

Now ZDecimal and graph 1/(X+1) again. The nearly vertical line at the asymptote disappears: because the value X=-1 matches a pixel on the graph, so the calculator realizes that something is undefined there.

Another similar problem occurs with graphing Y={-1,1}√(9-X²). In most graphing windows, this graph, which should come out to a circle, has some gaps near the sides. In an integer square window, such as with ZDecimal, the gaps disappear, and you're left with a perfect circle.

Coordinates are round numbers

This is a more programming-related application. If you happen to need to draw something on the screen, in a program, you're likely to need a lot of Line( or Pt-On( commands at fairly specific locations. On a normal window, such a "specific location" might end up being (2.553,0.645) or something equally ugly, with unpredictable results if you try to round it to the nearest nice value (since you don't know exactly the point at which pixels change).

With a friendly window (for this purpose, an integer window with (0,0) in the bottom left is the friendliest), every single pixel has a round coordinate value. If each value is no more than a 2-digit number, you can even compress all the coordinates of a line into a single number — this technique was used, for example, in Bryan Thomas' Contra game.

Point and pixel commands are compatible

In the case of an arbitrary window, it's fairly difficult to convert from a pixel coordinate to a point coordinate and back: the exact formula is X=Xmin+CΔX, Y=Ymax-RΔY if (X,Y) is the point and (R,C) is the pixel (going from pixel to point is even more painful). However, there are many cases in which you do need to go back and forth — for example, if you need to draw both text and lines at a coordinate. With friendly windows, this formula becomes much simpler — such as (X,Y)=(C,-R) for the last integer window we discussed.

SEQ-MODE.GIF

Command Summary

Enables sequence graphing mode.

Command Syntax

Seq

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows to select Seq.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Seq command enables sequence graphing mode.

Sequential mode is used for graphing sequences, which can be thought of as functions from the positive (or non-negative) integers. The TI-83 calculators let n be the independent variable in this situation, and the three sequences, instead of using subscripts, use the letters u, v, and w.

One of the main advantages of sequential mode is that it allows recursive definitions: u(n) can be defined in terms of u(n-1) and u(n-2). For recursive definitions to work, an initial case must be defined: this is done using the variables u(nMin), v(nMin), and w(nMin). The constant nMin is the initial case, for which the calculator will use a specific value rather than the formula.

For example, say a bunny population starts out at 100 and doubles each year. We can describe this situation using the recursive definition u(n)=2u(n-1) (this just says that the nth year population is twice the population of the previous year); then we set u(nMin)=100. Note that without u(nMin), the equation would be meaningless - without the initial population, we have no way to calculate any other population.

When you're using more than one previous value — both u(n-1) and u(n-2)) — you need more than one initial value, and then u(nMin) becomes a list.

Advanced Uses

Sequence graphing mode has several submodes that can be selected from the 2nd FORMAT screen. They are Time, Web, uvAxes, uwAxes, and vwAxes. Sequences are still defined in the same way, but these modes control the way that they're graphed.

The window variables that apply to sequence mode are:

  • nMin — Determines the minimum n-value calculated for equations.
  • nMax — Determines the maximum n-value calculated for equations.
  • PlotStart — Determines the first value of n that is actually graphed.
  • PlotStep — Determines the difference between consecutive graphed values of n.
  • Xmin — Determines the minimum X-value shown on the screen.
  • Xmax — Determines the maximum X-value shown on the screen.
  • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode.
  • Ymin — Determines the minimum Y-value shown on the screen.
  • Ymax — Determines the maximum Y-value shown on the screen.
  • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode.

Related Commands

POLAR-MODE.GIF

Command Summary

Enables polar graphing mode.

Command Syntax

Polar

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows to select Pol.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Polar command enables the polar graphing mode.

Unlike the previous modes, polar mode doesn't use the more common (x,y) coordinates. Instead, the coordinates (r,θ) are used, where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). Although it's possible to translate from one system to the other, polar coordinates are more useful for some expressions (and, of course, less useful for others).

In particular, they're very good at graphing anything circle-related. The equation for a circle in polar mode is just r=1 (or any other number, for a circle of different radius).

Like in parametric mode, the parameter θ uses the window variables θmin, θmax, and θstep to determine which points are graphed. A common situation is θmin=0, θmax=2π: in Radian mode, this corresponds to going all the way around the circle. Of course, you could use Degree mode and set θmax to be 360, but this is uncommon in mathematics.

Advanced Uses

The window variables that apply to polar mode are:

  • θmin — Determines the minimum θ-value graphed for equations.
  • θmax — Determines the maximum θ-value graphed for equations.
  • θstep — Determines the difference between consecutive θ-values.
  • Xmin — Determines the minimum X-value shown on the screen.
  • Xmax — Determines the maximum X-value shown on the screen.
  • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode.
  • Ymin — Determines the minimum Y-value shown on the screen.
  • Ymax — Determines the maximum Y-value shown on the screen.
  • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode.

Related Commands

PARAM.GIF

Command Summary

Enables parametric graphing mode.

Command Syntax

Param

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows to select Par.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Param command enables parametric graphing mode.

Parametric mode is in many ways a generalization of function mode. Instead of writing y as a function of x, both x and y are written as a function of a parameter t (hence the name, parametric mode). You can easily see that equations in function mode are just a special case of equations in parametric mode: if you set x equal to t, then writing y=f(t) is equivalent to writing y=f(x). Of course, graphing a function this way on a calculator will be slightly slower than doing it in function mode directly, because of the overhead.

Parametric mode allows you the greatest freedom of all the possible graphing modes - nearly every curve you could encounter can be expressed in parametric form.

In mathematics, the parameter t is commonly allowed to take on all values from negative to positive infinity. However, this would be impossible to do on a calculator, since the equation would never stop graphing (unlike function mode, there's no easy way to check for which values of t the equation will go off the screen and there's no need to graph it). Instead, the calculator has window variables Tmin, Tmax, and Tstep: it will evaluate the parameter at every value from Tmin to Tmax, increasing by Tstep each time, and 'connect the dots'.

Polar mode, which you'll read about in the next section, is also a special case of parametric mode: To graph r=f(θ), you can instead graph x=f(t)cos(t) and y=f(t)sin(t), with t graphed over the same interval as θ.

Advanced Uses

The window variables that apply to parametric mode are:

  • Tmin — Determines the minimum T-value graphed for equations.
  • Tmax — Determines the maximum T-value graphed for equations.
  • Tstep — Determines the difference between consecutive T-values.
  • Xmin — Determines the minimum X-value shown on the screen.
  • Xmax — Determines the maximum X-value shown on the screen.
  • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode.
  • Ymin — Determines the minimum Y-value shown on the screen.
  • Ymax — Determines the maximum Y-value shown on the screen.
  • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode.

Related Commands

FUNC.GIF

Command Summary

Enables function graphing mode.

Command Syntax

Func

Menu Location

While editing a program, press:

  1. MODE to access the mode menu.
  2. Use arrows to select Func.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Func command enables function graphing mode. This is usually unnecessary in a program, but if you want to graph a Y# equation, you'd want to make sure the calculator is in function mode first.

In function mode, you can graph equations where y (the vertical coordinate) is a function of x (the horizontal coordinate). This mode is most commonly discussed in algebra and single-variable calculus courses. Many curves, such as a parabola, have simple expressions when written in the form y=f(x).

However, in function mode, many expressions cannot be graphed at all. For example, a circle can't be easily graphed in function mode, since for some x-values, there are two y-values. Using two functions, you can achieve a circle, but it will still require a friendly graphing window to display perfectly.

Many calculator features are specifically targeted at function mode graphing. For example, two graphing styles (see GraphStyle() can be only used with function mode. The DrawF command draws a function in graphing mode.

Advanced Uses

The window variables that apply to function mode are:

  • Xmin — Determines the minimum X-value shown on the screen.
  • Xmax — Determines the maximum X-value shown on the screen.
  • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode.
  • Ymin — Determines the minimum Y-value shown on the screen.
  • Ymax — Determines the maximum Y-value shown on the screen.
  • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode.
  • Xres — Determines the pixel distance between points used for graphing. This is a value 1-8: 1 for best quality, 8 for best speed.

Related Commands

The TI-83 series of graphing calculators can graph equations in four modes: function mode, parametric mode, polar mode, and sequential mode.

Since this website is primarily aimed at calculator programmers, rather than all calculator users, this information may not have many immediate applications, since graphing equations isn't often useful in programs. However, math programs may require information such as this, and in general, the better you understand all the features of your calculator, the better you'll be able to program it.

The four graphing modes are enabled with the Func, Param, Polar, and Seq commands.

Function Mode

In function mode, you can graph equations where y (the vertical coordinate) is a function of x (the horizontal coordinate). This mode is most commonly discussed in algebra and single-variable calculus courses. Many curves, such as a parabola, have simple expressions when written in the form y=f(x).

However, in function mode, many expressions cannot be graphed at all. For example, a circle can't be easily graphed in function mode, since for some x-values, there are two y-values. Using two functions, you can achieve a circle, but it will still require a friendly graphing window to display perfectly.

Many calculator features are specifically targeted at function mode graphing. For example, two graphing styles (see GraphStyle() can be only used with function mode. The DrawF command draws a function on the graph screen.

Parametric Mode

Parametric mode is in many ways a generalization of function mode. Instead of writing y as a function of x, both x and y are written as a function of a parameter t (hence the name, parametric mode). You can easily see that equations in function mode are just a special case of equations in parametric mode: if you set x equal to t, then writing y=f(t) is equivalent to writing y=f(x). Of course, graphing a function this way on a calculator will be slightly slower than doing it in function mode directly, because of the overhead.

Parametric mode allows you the greatest freedom of all the possible graphing modes - nearly every curve you could encounter can be expressed in parametric form.

In mathematics, the parameter t is commonly allowed to take on all values from negative to positive infinity. However, this would be impossible to do on a calculator, since the equation would never stop graphing (unlike function mode, there's no easy way to check for which values of t the equation will go off the screen and there's no need to graph it). Instead, the calculator has window variables Tmin, Tmax, and Tstep: it will evaluate the parameter at every value from Tmin to Tmax, increasing by Tstep each time, and 'connect the dots'.

Polar mode, which you'll read about in the next section, is also a special case of parametric mode: To graph r=f(θ), you can instead graph x=f(t)cos(t) and y=f(t)sin(t), with t graphed over the same interval as θ.

Polar Mode

Unlike the previous modes, polar mode doesn't use the more common (x,y) coordinates. Instead, the coordinates (r,θ) are used, where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). Although it's possible to translate from one system to the other, polar coordinates are more useful for some expressions (and, of course, less useful for others).

In particular, they're very good at graphing anything circle-related. The equation for a circle in polar mode is just r=1 (or any other number, for a circle of different radius).

Like in parametric mode, the parameter θ uses the window variables θmin, θmax, and θstep to determine which points are graphed. A common situation is θmin=0, θmax=2π: in Radian mode, this corresponds to going all the way around the circle. Of course, you could use Degree mode and set θmax to be 360, but this is uncommon in mathematics.

Sequential Mode

Sequential mode is used for graphing sequences, which can be thought of as functions from the positive (or non-negative) integers. The TI-83 calculators let n be the independent variable in this situation, and the three sequences, instead of using subscripts, use the letters u, v, and w.

One of the main advantages of sequential mode is that it allows recursive definitions: u(n) can be defined in terms of u(n-1) and more generally in terms of u(n-k) for any k. For recursive definitions to work, an initial case must be defined: this is done using the variables u(nMin), v(nMin), and w(nMin). The constant nMin is the initial case, for which the calculator will use a specific value rather than the formula.

For example, say a bunny population starts out at 100 and doubles each year. We can describe this situation using the recursive definition u(n)=2u(n-1) (this just says that the nth year population is twice the population of the previous year); then we set u(nMin)=100. Note that without u(nMin), the equation would be meaningless - without the initial population, we have no way to calculate any other population.

When you're using more than one previous value (for example, u(n-1) and u(n-2)) you need more than one initial value, and then u(nMin) becomes a list.

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

  • seq(, the list command evaluating an expression at several values.
  • Seq, the mode command that selects sequential graphing mode.
  • Sequential, the mode command that sets equations to graph one after the other.

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

GRAPHSTYLE.GIF

Command Summary

Sets the graphing style of a graphing equation in the current mode.

Command Syntax

GraphStyle(equation #, style #)

Menu Location

While editing a program, press:

  1. PRGM to access the programming menu.
  2. ALPHA H to select GraphStyle(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The GraphStyle( command allows you to set the graphing style of an equation (line, thick line, dotted line, etc.) from within a program.

Its first argument, equation #, is the number of the equation whose graphing style you want to change - this depends on the mode you're in. For example, if you wanted to change the graphing style of Y1, you would need to be in function mode and use the value 1 for this argument. If you wanted to change the graphing style of r4, you would need to be in polar mode and use the value 4.

The second argument is a number from 1 to 7, which translates to a graphing style as follows:

  • 1 - a normal line, usually the default graph style.
  • 2 - a thick line (three pixels wide).
  • 3 - a line, with everything above it shaded (only valid in function mode).
  • 4 - a line, with everything below it shaded (only valid in function mode).
  • 5 - a path: a line, with a ball moving along it as it is graphed (not valid in sequential mode).
  • 6 - animated: a ball moving along the graph (not valid in sequential mode).
  • 7 - a dotted line.

Compare this to the effect of Connected or Dot mode. When either of these modes is set, all equations, from all graphing modes, are reverted to line style or dotted line style respectively; furthermore, it becomes the default graph style and clearing an equation will revert it to this graph style. The GraphStyle( command simply overrides these modes temporarily.

Advanced

In shading modes (3 and 4), the shading style cycles as follows:

  • The first function graphed shades using vertical lines one pixel apart
  • The second function shades using horizontal lines one pixel apart
  • The third function shades using negatively sloping diagonal lines, two pixels apart.
  • The fourth function shades using positively sloping diagonal lines, two pixels apart.
  • After that, functions will cycle through these four styles in that order.

Error Conditions

  • ERR:DOMAIN if the equation # is not a valid equation number in this mode, or if style # is not an integer 1-7.
  • ERR:INVALID if the graphing style chosen is not valid for the current graphing mode.

Related Commands

DELTALIST.GIF

Command Summary

Calculates the differences between consecutive terms of a list.

Command Syntax

ΔList(list)

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. RIGHT to access the OPS submenu.
  3. 7 to select ΔList(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

ΔList( calculates the differences between consecutive terms of a list, and returns them in a new list.

ΔList({0,1,4,9,16,25,36})
    {1 3 5 7 9 11}

Advanced Uses

The ΔList( command is very nearly the inverse of the cumSum( command, which calculates the cumulative sums of a list. For any list, ΔList(cumSum(list)) will return the same list, but without its first element:

ΔList(cumSum({1,2,3,4,5,6,7}))
    {2 3 4 5 6 7}

Removing the first element would otherwise be a difficult procedure involving the seq( command, so this is a useful trick to know.

If a list is sorted in ascending order, min(ΔList(list)) will return 0 (false) if there are repeating values in the list, and a value corresponding to true if they are all distinct.

Error Conditions

Related Commands

CUMSUM.GIF

Command Summary

Calculates cumulative sums of a list or of the columns of a matrix.

Command Syntax

cumSum(list or matrix)

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. RIGHT to access the OPS submenu.
  3. 6 to select cumSum(, or use arrows.

Alternatively, press:

  1. MATRIX (TI-83) or 2nd MATRIX (TI-83+ or higher) to access the matrix menu.
  2. RIGHT to access the MATH submenu.
  3. 0 to select cumSum(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

cumSum( calculates the cumulative sums of a list, or of the columns of a matrix, and outputs them in a new list or matrix variable.

For a list, this means that the Nth element of the result is the sum of the first N elements of the list:

cumSum({1,3,5,7,9})
    {1 4 9 16 25}

For a matrix, cumSum( is applied to each column in the same way as it would be for a list (but numbers in different columns are never added):

[[0,1,1][0,1,3][0,1,5][0,1,7]]
    [[0 1 1]
     [0 1 3]
     [0 1 5]
     [0 1 7]]
cumSum(Ans)
    [[0 1 1]
     [0 2 4]
     [0 3 9]
     [0 4 16]]

Advanced Uses

The ΔList( command is very nearly the inverse of the cumSum( command - it calculates the differences between consecutive elements. For any list, ΔList(cumSum(list)) will return the same list, but without its first element:

ΔList(cumSum({1,2,3,4,5,6,7}))
    {2 3 4 5 6 7}

Removing the first element would otherwise be a difficult procedure involving the seq( command, so this is a useful trick to know.


For a matrix, if you want to sum up the rows instead of the columns, use the T (transpose) command.

Related Commands

System variables are, for the purposes of this guide, variables that certain commands will use or modify without asking (i.e. without supplying them in the command's arguments). This is a somewhat ill-defined category, and in fact the system variables we'll discuss are of a somewhat miscellaneous nature. They include equation and plot variables, window and table parameters, statistical variables, and finance variables.

Equation variables and plot variables

The equation variables include Y0 through Y9 (function variables), X1T and Y1T through X6T and Y6T (parametric variables), r1 through r6 (polar variables), and u, v, w (sequential variables). They are used when graphing an equation on the graph screen. From the point of view of a programmer, it's important to realize that these variables are actually strings in disguise. That is to say, they are stored internally as strings, though the string operations and commands won't work on them. Instead, the following operations are valid for equations:

  • Evaluating them, by using the equation variable in an expression.
  • Evaluating them at a point, using the syntax EqVar(value) - for example, Y1(5). This will plug value in for the independent variable - X, T, θ, or n for function, parametric, polar, and sequential variables respectively.
  • Storing a string to them.
  • Using the Equ►String( or String►Equ( command to go back and forth from string to equation form.

In addition to their string contents, an equation variable contains two other pieces of information - the graphing style, set with the GraphStyle( command, and the state (enabled or disabled), set with the FnOn and FnOff commands. There is unfortunately, no way to find out which graphing style or state a variable is in, you can only set these to a value.

Plot variables are used for displaying data graphically, in one of six styles: scatter plot, line plot, histogram, box plot, modified box plot, and normal plot. What the variables actually store varies with the plot type, but includes one or more data lists, and settings. All of this can be set with the PlotN( command. All or some plots can be turned on and off with the PlotsOn and PlotsOff commands. The Select( command is also useful for dealing with plots.

Window and table parameters

These store auxiliary information about the graphing window and include:

  • Xmin, Xmax, Ymin, Ymax — determine the lower and upper X and Y bounds of the graph screen itself.
  • ΔX, ΔY — defined to be (Xmax-Xmin)/94 and (Ymax-Ymin)/62 respectively; storing to them will change Xmax and Ymax to arrange this.
  • Xscl, Yscl — determine how wide the marks on the axes (and, with GridOn, the grid marks) are spaced.
  • Xres — determines the quality of Function graphing (how many pixels apart points are calculated), and must be an integer 1-8.
  • Tmin, Tmax, Tstep — determine the values at which T is evaluated in Parametric graphing (as though it were a For( loop).
  • θmin, θmax, θstep — the same idea, but for the θ variable in Polar graphing.
  • nMin, nMax — bounds for the n variable to evaluate (the step is always 1; also, these must be integers).
  • u(nMin), v(nMin), w(nMin) - override the value of u, v, and w at nMin, for the purposes of recursively defining them.
  • PlotStart, PlotStep — actually have nothing to do with plots, but determine which values of n are graphed.
  • all of the above have a Z equivalent (ZXmin, Zθstep, etc.) that's used by ZoomSto and ZoomRcl.
  • XFact, YFact — the scaling factors for Zoom In and Zoom Out.
  • TblStart, ΔTbl — the starting value and step for the independent variable in the table screen.
  • TblInput — a 7-element list of the values of a variable in the table.

When transferring variables between calculators, or grouping variables, these variables are grouped in Window, rclWindow, and TblSet.

You can store to each of the window variables directly, or use the zoom commands, which affect multiple variables at once to achieve some effect.

You can use these to some extent as real variables to store values in a program, but their use is limited to the home screen (because they affect the graph screen) and there are limits to their ranges. For example, Xmax must be greater than Xmin.

Statistical Variables

These cannot be stored to, although their values can be used - instead they are modified by statistical commands, which use them as output. See the statistics pages for more information. Notably, the list |LRESID is taken up on the CE.

Finance Variables

The seven finance variables are N, I%, PV, PMT, FV, P/Y, and C/Y. They are used by the finance solver tool; to use the solver in a program, set these variables to the values you want, choose one of the options Pmt_End or Pmt_Bgn, and then use the value tmv_VAR (where VAR is the variable you want to solve for).

Another use of the finance variables is in speed-critical sections of code: they are faster to access even than Ans. Somewhat off-setting this advantage is the fact that they are two byte tokens, and that they don't work as the variables of a seq( command or a For( loop (they will actually throw a ERR:SYNTAX error) or IS>( and DS>(. In addition the value of C/Y is altered when P/Y is altered.

FILL.GIF

Command Summary

Fills a list or matrix with one number.

Command Syntax

Fill(value,matrix)

Menu Location

Press:

  1. 2nd LIST to access the list menu.
  2. RIGHT to access the OPS submenu.
  3. 4 to select Fill(, or use arrows.

Alternatively, press:

  1. MATRX (83) or 2nd MATRX (83+ or higher) to access the matrix menu.
  2. RIGHT to access the MATH submenu.
  3. 4 to select Fill(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The Fill( command takes an existing list or matrix variable and sets all its elements to a single number. It doesn't return anything and only works on already defined variables.

{5}→dim(L1)
Fill(2,L1)
L1
    {2 2 2 2 2}

{3,4}→dim([A])
Fill(1,[A])
[A]
    [[1 1 1 1]
     [1 1 1 1]
     [1 1 1 1]]

Fill( is very fast: on a twenty-element real list, it takes only about 3.5 ms, much less than any vectorized list operation.

When Fill( is called on a list, the datatype of the list becomes the datatype of the number. That is, Fill(1,L₁) makes L₁ a real list, and Fill(i,L₁) makes L₁ a complex list.

Optimization

When creating a new list or matrix you want to fill with zeroes, it's better to delete it then create it with dim(, which will set all entries to 0, than to set its dimensions with dim( (which may not clear what was there before) then use Fill(.

Errors

On a TI-84+CSE, using Fill(List,List) will cause a RAM clear. For example: Fill({1,2,3},{1,2,3} will cause a RAM Clear. This does not apply on any other models, as they only give you argument and data type errors.

Related Commands

T.GIF

Command Summary

This command calculates the transpose of a matrix.

Command Syntax

matrixT

Menu Location

Press:

  1. MATRX (on the 83) or 2nd MATRX (83+ or higher) to access the Matrix menu.
  2. LEFT to access the MATH submenu
  3. 2 to select T, or use arrows

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

The T command is used to calculate the transpose of a matrix: it flips a matrix along its main diagonal. This means that the (i,j)th element becomes the (j,i)th element, and vice versa. As a result, the transpose of an M by N matrix is an N by M matrix.

[[1,2,3][4,5,6]]
………… [[1 2 3]
…………. [4 5 6]]
AnsT
………… [[1 4]
…………. [2 5]
…………. [3 6]]

Advanced Uses

In addition to its many uses in linear algebra, the T operation is useful to programmers: with operations such as Matr►list( and augment(, which normally deal with columns, T allows you to use rows instead. See the "Related Commands" section for the commands that this is useful for.

Related Commands

RANDBIN.GIF

Command Summary

Generates a random number with the binomial distribution.

Command Syntax

randBin(n,p,# simulations)

Menu Location

Press:

  1. MATH to access the math menu.
  2. LEFT to access the PRB submenu.
  3. 7 to select randBin(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

randBin(n,p) generates a pseudorandom integer between 0 and n inclusive according to the binomial distribution B(n,p) - that is, n trials of an event with probability of success p are performed, and the number of successes is returned. randBin(n,p,simulations) performs the above calculation simulations times, and returns a list of the results. The expected (average) result is n*p.

n should be an integer greater than or equal to 1, while p should be a real number between 0 and 1 inclusive.

seed→rand affects the output of randBin(

0→rand
     0
randBin(5,1/2
     2
randBin(5,1/2,10
     {3 3 2 4 3 2 2 2 4 3}

Formulas

The value of randBin( for a given seed can be expressed in terms of rand:

randBin(N,P)=sum(P>rand(N

This is identical to the output of randBin( in the sense that for the same seed, both expressions will generate the same random numbers.

Error Conditions

  • ERR:DOMAIN is triggered if the probability is not on the interval from 0 to 1.

Related Commands

RANDNORM.GIF

Command Summary

Generates a random normally-distributed number with specified mean and standard deviation.

Command Syntax

randNorm(µ,σ,[n])

Menu Location

Press:

  1. MATH to access the math menu.
  2. LEFT to access the PRB submenu.
  3. 6 to select randNorm(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

randNorm(µ,σ) generates a normally-distributed pseudorandom number with mean µ and standard deviation σ. The result returned will most probably be within the range µ±3σ. randNorm(µ,σ,n) generates a list of n normally-distributed pseudorandom numbers with mean µ and standard deviation σ.

seed→rand affects the output of randNorm(.

0→rand
     0
randNorm(0,1)
     -1.585709623
randNorm(0,1,3)
     {-1.330473604 1.05074514 -.0368606663}

Although a theoretical normally distributed variable could take on any real value, numbers on a calculator have a limited precision, which leads to a maximum range of approximately µ±7.02σ for values of randNorm(.

Optimization

When the mean is 0 and the standard deviation 1, invNorm(rand) and invNorm(rand(N)) save space over randNorm(0,1) and randNorm(0,1,N) respectively.

Formulas

The value of randNorm( for a given seed can be expressed in terms of rand:

randNorm(µ,σ)=µ-σinvNorm(rand

This is identical to the output of randNorm( in the sense that for the same seed, both expressions will generate the same random numbers.

The following formula can be used to get a target interval where A and B are two real intervals.

µ=(A+B)/2
σ=(-A+B)/6

Related Commands

RANDINT.GIF

Command Summary

Generates a random integer between min and max, inclusive, or a list of such numbers.

Command Syntax

randInt(min,max[,# of numbers])

Menu Location

Press:

  1. MATH to access the math menu.
  2. LEFT to access the PRB submenu.
  3. 5 to select randInt(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

randInt(min,max) generates a uniformly-distributed pseudorandom integer between min and max inclusive. randInt(min,max,n) generates a list of n uniformly-distributed pseudorandom integers between min and max.

seed→rand affects the output of randInt(.

0→rand
     0
randInt(1,10)
     10
randInt(1,10,5)
     {10 2 6 5 8}

Optimization

When the lower bound of randInt( is 0, you can replace it with int(#rand to save space. For example:

:randInt(0,12
can be
:int(13rand

Similarly, if you don't want to include zero in the range, you can use a variant of 1-#int(#rand:

:1-2int(2rand

In this particular example, the only values that you will ever get are -1 or 1.

Formulas

The value of randInt( for a given seed can be expressed in terms of rand:

randInt(A,B)=

  • when A<B, A+int((B-A+1)rand
  • otherwise, B+int((A-B+1)rand

This is identical to the output of randInt( in the sense that for the same seed, both expressions will generate the same random numbers.

Error Conditions

  • ERR:DOMAIN is thrown if any of the arguments is a decimal.
  • ERR: DATA TYPE is given if you use imaginary numbers like 6i or something like Matrices or Lists. This error is used instead of ERR:DOMAIN for "i".

Related Commands

FACTORIAL.GIF

Command Summary

Calculates the factorial of a number or list.

Command Syntax

value!

Menu Location

Press:

  1. MATH to access the math menu.
  2. LEFT to access the PRB submenu.
  3. 4 to select !, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

! is the factorial function, where n! = n*(n-1)! and 0! = 1, n an nonnegative integer. The function also works for arguments that are half an odd integer and greater than -1/2: $(-\frac1{2})!$ is defined as $\sqrt{\pi}$ and the rest are defined recursively. 69 is the largest number for which the calculator can perform the operation.

3!
     6
(‾.5)!
     1.772453851
Ans²
     3.141592654

The combinatorial interpretation of factorials is the number of ways to arrange n objects in order.

Error Conditions

  • ERR:DOMAIN for any numbers except the ones mentioned above.

Related Commands

NCR.GIF

Command Summary

Calculates the combinatorial number of combinations.

Command Syntax

a nCr b

Menu Location

Press:

  1. MATH to access the math menu.
  2. LEFT to access the PRB submenu.
  3. 3 to select nCr, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

nCr is the number of combinations function (or binomial coefficient), defined as a nCr b = a!/(b!*(a-b)!), where a and b are nonnegative integers. The function also works on lists.

Tip: nCr has a higher priority in evaluation than operators such as + or *: for example, 5X nCr 10 will be interpreted as 5(X nCr 10) and not as (5X) nCr 10. You might wish to use parentheses around complex expressions that you will give to nCr as arguments.

6 nCr 4
     15

The combinatorial interpretation of a nCr b is the number of ways to choose b objects, out of a total of a, if order doesn't matter. For example, if there 10 possible pizza toppings, there are 10 nCr 3 ways to choose a 3-topping pizza.

Error Conditions

  • ERR:DIM MISMATCH is thrown when applying nCr to two lists that have different dimensions.
  • ERR:DOMAIN is thrown for negative integers or decimals.

Related Commands

NPR.GIF

Command Summary

Calculates the combinatorial number of permutations.

Command Syntax

a nPr b

Menu Location

Press:

  1. MATH to access the math menu.
  2. LEFT to access the PRB submenu.
  3. 2 to select nPr, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

1 byte

nPr is the number of permutations function, defined as a nPr b = a!/(a-b)!, where a and b are nonnegative integers. The function also works on lists.

Tip: nPr has a higher priority in evaluation than operators such as + or *: for example, 5X nPr 10 will be interpreted as 5(X nPr 10) and not as (5X) nPr 10. You might wish to use parentheses around complex expressions that you will give to nPr as arguments.

6 nPr 4
     360

The combinatorial interpretation of a nPr b is the number of ways to choose b objects in order, when there are a objects in total. For example, when giving 1st, 2nd, and 3rd place awards in a competition between 10 teams, there are 10 nPr 3 different ways to assign the awards.

Error Conditions

  • ERR:DIM MISMATCH is thrown when applying nPr to two lists that have different dimensions.
  • ERR:DOMAIN is thrown for negative integers or decimals.

Related Commands

RAND.GIF

Command Summary

Generates a random number between 0 and 1, or a list of such numbers. Can also be used to set the random number seed.

Command Syntax

rand

rand(# of numbers)

seed→rand

Menu Location

Press:

  1. MATH to access the math menu.
  2. LEFT to access the PRB submenu.
  3. ENTER to select rand.

Calculator Compatibility

TI-83/84/+/SE/CE

Token Size

1 byte

rand generates a uniformly-distributed pseudorandom number (this page and others will sometimes drop the pseudo- prefix for simplicity) between 0 and 1. rand(n) generates a list of n uniformly-distributed pseudorandom numbers between 0 and 1. seed→rand seeds (initializes) the built-in pseudorandom number generator. The factory default seed is 0.

L'Ecuyer's algorithm is used by TI calculators to generate pseudorandom numbers.

0→rand
     0
rand
     .9435974025
rand(2)
     {.908318861 .1466878292}

Note: Due to specifics of the random number generating algorithm, the smallest number possible to generate is slightly greater than 0. The largest number possible is actually 1, but since returning a result of 1 would mess up the output of randBin( and randNorm(, the actual value returned in such cases is 1-1.11e-12 (which is displayed as 1, and is "equal" to 1 for the purposes of the = command). To see 1, store 196164532 to rand and then run the random number generator. If you instead try to store the “random” value directly to a list element, the value as viewed inside of the list editor will be 1-1.11e-12, displayed as 0.99999999999889.

Advanced Uses

To seed the random number generator, store a positive integer to rand (the command will ignore any decimals, and the sign of the number). Seeding the random number generator has several uses:

When writing a program that uses random numbers, you may add a 0→rand instruction to the beginning of the program — this ensures that the program's actions will be repeatable, making it easier to fix a bug. Just don't forget to take it out when you've finished writing the program.

Seeding the random number generator can also be used to create fairly secure (unbreakable without a computer) encryption. Pick a secret key, and store it to rand as a seed. Then, perform some randomly generated manipulations on the data you want to encode — for example, shifting each character of a string by a random number. Decoding the message is simple: store the secret key to rand and perform the opposite of those random operations. However, this is impossible to do if you don't know the secret key.


When seeding the random number generator, as above, you make every random number generated afterwards predictable. This may be problematic even if your program doesn't need random numbers, because other programs might. To prevent this, use the following code to save and restore "randomness":

:randInt(1,E9)→N

(code that involves seeding the RNG here)

:N→rand


Since generating random numbers is a fairly time-consuming operation, the rand(# of numbers) syntax is very effective at generating a delay in your program — just add the line:

:rand(N)

The bigger N is, the longer the delay. In relation to the commonly used For( loop delay, the number used in the rand( delay is about 10 times smaller. However, this code has a side effect of storing a list of random numbers to Ans, which may be undesirable. To avoid this, use this somewhat longer line:
:If dim(rand(N))

Despite the presence of an If statement, you don't have to worry about the next line being skipped, since dim(rand(N)) will always be true.

Error Conditions

  • ERR:DOMAIN if you try to generate a list of random numbers and the list length isn't an integer 1-999.

Related Commands

IMAG.GIF

Command Summary

Returns the imaginary part of a complex number.

Command Syntax

imag(value)

Menu Location

Press:

  1. MATH to access the math menu.
  2. RIGHT, RIGHT to access the CPX (complex) submenu.
  3. 3 to select imag(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

imag(z) returns the imaginary part of the complex number z. If z is represented as x+iy where x and y are both real, imag(z) returns y. Also works on a list of complex numbers.

imag(3+4i)
     4

imag({3+4i,-2i,17})
     {4,-2,0}

Related Commands

REAL.GIF

Command Summary

Returns the real part of a complex value.

Command Syntax

real(value)

Menu Location

Press:

  1. MATH to access the math menu.
  2. RIGHT, RIGHT to access the CPX (complex) submenu.
  3. 2 to select real(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

real(z) returns the real part of the complex number z. If z is represented as x+iy where x and y are both real, real(z) returns x. Also works on a list of complex numbers.

real(3+4i)
     3

Advanced Uses

The real( command is expanded by several assembly libraries (such as xLIB and Omnicalc) to call their own routines. If xLib is installed, then real( will no longer work as intended even in programs that want to use it for its intended purpose.

If you actually want to take the real part of a complex number, and want the program to work with one of these assembly libraries, you could use the imag( command instead - real(Z) is equivalent to imag(Zi). Alternatively, you could tell people using your program to uninstall xLIB or Omnicalc first.

If a program you downloaded has an error and 2:Goto takes you to a line with real( and a bunch of arguments, this is probably because the program uses Omnicalc or xLIB which you don't have installed.

Related Commands

See Also

ANGLE.GIF

Command Summary

Returns the complex argument of a complex number.

Command Syntax

angle(z)

Menu Location

Press:

  1. MATH to access the math menu.
  2. RIGHT, RIGHT to access the CPX (complex) submenu
  3. 4 to select angle(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE/CSE/CE

Token Size

2 bytes

angle(z) returns the complex argument (also known as the polar angle) of the complex number z. If z is represented as x+iy where x and y are both real, angle(z) returns R►Pθ(x,y) (which is equivalent to tanֿ¹(y/x) if x is nonzero). Also works on a list of complex numbers.

angle(3+4i)
     .927295218
R►Pθ(3,4)
     .927295218

When writing a complex number z in the form $re^{i\theta}$ (or, equivalently, $r(\cos\theta+i\sin\theta)$), then $\theta$ is equal to the value of angle(z), suitably reduced so that the result returned is in the interval $-\pi<\theta\leq\pi$.

The angle( command also works on matrices, though not in any useful way: angle([A] will return a matrix of the same size as [A], but with all elements 0. If you plan to use this, don't: 0[A] does the same thing, but is smaller and not as questionable (because this behavior is clearly unintentional on TI's part, and may be changed in an OS update).

Related Commands

CONJ.GIF

Command Summary

Calculates the complex conjugate of a complex number.

Command Syntax

conj(value)

Menu Location

Press:

  1. MATH to access the math menu.
  2. RIGHT, RIGHT to access the CPX (complex) submenu
  3. ENTER to select conj(.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

conj(z) returns the complex conjugate of the complex number z. If z is represented as x+iy where x and y are both real, conj(z) returns x-iy. Also works on a list of complex numbers.

conj(3+4i)
     3-4i

The conjugate of a number $z$ is often written $\overline{z}$, and is useful because it has the property that $z\overline{z}$ and $z+\overline{z}$ are real numbers.

Related Commands

GCD.GIF

Command Summary

Finds the greatest common divisor of two values.

Command Syntax

gcd(value1, value2)

Menu Location

Press:

  1. MATH to access the math menu.
  2. RIGHT to access the NUM submenu.
  3. 9 to select gcd(, or use arrows.

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The gcd( command returns the greatest common divisor (GCD) of two nonnegative integers. It also works on lists.

gcd(8,6)
     2
gcd({9,12},6)
     {3 6}
gcd({14,12},{6,8})
     {2 4}

Advanced Uses

A gcd( command can be nested inside another gcd( command to compare up to four numbers.

Error Conditions

  • ERR:DIM MISMATCH is thrown if the arguments are two lists that don't have the same number of elements.
  • ERR:DOMAIN is thrown if the arguments aren't positive integers (or lists of positive integers) less than 1E12.

Related Commands

See Also

page 11 of 12« previous12...9101112next »

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.