Disaster
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
 Oct 30 — Timothy Foster continues work on the starter kit after many days of no development.

Sometimes, you need to just separate one thing from another, want some sort of pop-up window, or want a nice looking frame for the menu on your game. Well, here's some ways on how to do just that.

# Making Windows

• Pen
• The Pen tool helps you to make lines that are continuous. Good to use if you don't want to repeatedly use the Line( command
• Line(
• The Line( command allows you to draw straight lines on the graphscreen
• Horizontal and Vertical
• Much like the name says, the Horizontal command draws a horizontal line and the Vertical command draws a vertical line
• Circle
• The Circle( command allows you to draw a circle at a specified point.
• The POINTS commands

# Full Screen Windows

When you need to put your game or program in some sort of "frame," then you need to decide what you are going to use it for. If you want to have something that looks very professional, and have it still look simple, here is one way to do that:

If you want a window for a game, say one that is supposed to look medieval, then this might be an appropriate window:

You just have to experiment with what window looks good and what would work with your game/program.

# Pop-up Windows

Pop up windows are a great way to show the user some sort of information. For example, if you have made a game that uses the list "GAME", then you can put a pop-up menu using RecallPic if the dimensions of the list is 0 (meaning that the user hasn't played your game before).

Setupeditor GAME
If dim(GAME)=0:Then
RecallPic 1  //You can replace "1" with any other picture variable
End


Here is a picture of a popup menu like that:

# Game screen

If you want a game screen to show your game statistics like health, money, number of battles, current level, or your character name, then you could use a layout screen for a game. Let's use the medieval screen from above.

# Recalling Windows

As stated previously, you can call your windows in a program with the RecallPic command. For more information on how to make windows/the graphscreen, you can look at the Advanced Graphics section of the TI-Basic Starter Kit (specifically here).
You can create your own window if you want, but these are some suggestions.

The final data type is the string. A string is a form of representing a phrase. Before, you could only use numbers, but a string will hold numbers, letters, and almost every possible character. This proves very useful because strings can serve multi-functions very easily. They can be used as variables, outputs in the form of numbers or words, and converters. Below, we will discuss how to use strings.

# Setting up Strings

There are ten different strings: Str0 to Str9. Unlike lists or matrices, strings do not use the dim( command to determine its length. Also, strings do not have a special SetUpEditor command. So, you need to be careful with archiving or unarchiving strings. Fortunately, beyond that, there are no special set up requirements. All you have to be sure of when dealing with strings is whether it is archived or not and whether the string already has something in it.

# Writing Strings

Strings have an infinite dimension as long as it fits in the RAM. Unlike with lists or matrices, strings are not a way to represent numbers and expressions, but it represents phrases, and phrases are dictated with quotations. So, when writing a string, you must precede the phrase with quotations.

:"HELLO, WORLD"→Str1


You can store practically any character into a string, but you cannot store the →. So, let's say you wanted to store a quadratic equation, 2x2+4x+8, into a string. Just precede with quotations and write:
:"2x²+4x+8"→Str1


# Using Strings

Strings are used in various ways. The reason strings are so powerful is that they can be used for many different applications, they are small, and they can be made very large if need be. Strings are commonly used as a form of outputting words or numbers in a prettier fashion, but strings can also be used like a variable, and much more efficiently at that.

## Output

First off, strings are most commonly used for output. For example, programmers would store bits and pieces of information into a string and then display it at the end to get a final output. For example, look at this code. All it is doing is testing a condition (which phrase to store in the string) and acting upon it.

:If A=3
:Then
:"You WIN!"→Str3
:Else
:"You LOSE."→Str3
:End
:Disp Str3


However, this code seems a little redundant, since all you need to do is simply display the phrase before storing into a string. However, strings have a special little quirk that allows them to be "added" together. What the calculator does is if it finds the addition of two strings, it will combine the strings together into one super phrase, much like what augment( does with lists. With this in mind, we can actually have initial strings and combine things into the strings depending on some conditions to receive an output. So the above code can be turned into this:
:"YOU_"→Str3 //(The _ is a space)
:If A=3
:Then
:Disp Str3+"WIN!"
:Else
:Disp Str3+"LOSE."
:End


This stores "YOU" with a space into Str3. Depending on the condition, the program will combine that string with either WIN! or LOSE.

The sub( command is very useful. It can be used to display YOU WIN or YOU LOSE in a more simple way than previously described. sub( has three arguments, the string to get data out of, the position in that string to start retrieving data, and the length of the string to be extracted. Here is how you would display YOU WIN or YOU LOSE without If-Then statements.

Disp "YOU "+sub("WIN LOSE",1+4(A=3),4


Also, consider this code.

:"_"→Str2
:For(A,1,7)
:A+2(A≥3)(A≤4)-2(A≥5)(A≤6)→A
:Str2+sub("AWESOME",A,1)→Str2
:End
:Disp Str2


This code uses strings to unscramble AWESOME. Don't fret…it may look complicated, but it isn't all that hard. We are using a For( loop to run through each letter. The next line changes A to the appropriate position in the messed-up string. The sub( command then finds the letter indicated by A and stores it into Str2 along with any letter already there. So you see, strings are very powerful!

## Variable Usage

Strings can also be used as a variable. There is a very special command called expr( that solves the string as if it was an expression. So, if Str4 was defined as "2+2", then expr(Str4) would be the number 4. However, with this new ability, there comes a new type of usage.

A power like this can be used as a variating variable. In other words, you can set the string value to change when other real variables change using expr(. Consider this code.

:"A+B"→Str1
:5→A:4→B
:Disp expr(Str1)
:A+0.5B→B
:Disp expr(Str1)
:Disp Str1


This code gives an output of 9, 11, and A+B. The whole time, the string remained the same, but when A or B changed, so did expr(Str1). This is an advanced technique known as Self Modifying Code, or at least one variation thereof. You won't be needing this for now, but this just shows you exactly how powerful strings can be. There are so many things you can do such as store coordinates and use sub( to take them out. As you can see, this data type has a lot power within the programming language.

# Cleaning Up

If you don't want the string, you can simply delete it. If you want to keep it, simply archive it for storage.

# Final Notes

That concludes the theory of strings (of course, nothing related to String Theory…) and the end of learning data types. These data types are used widely in BASIC programming, and it is highly recommended you begin practicing with each. As for now, the next lesson delves you into the realm of random numbers, one of the core components of games today.

The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.
The ListPages module does not work recursively.

Command Summary

Calculates the linear regression of two sets of data with a confidence interval for the slope coefficient.

Command Syntax

LinRegTInt [x-list, y-list, [frequency], [confidence level], [equation]]

Menu Location

Press:

1. STAT to access the statistics menu
2. RIGHT to access the TESTS submenu
3. ALPHA G to select LinRegTInt, or use arrows

TI-84+(SE) OS 2.30 or greater

2 bytes

Like LinReg(ax+b) and similar commands, LinRegTInt finds the best fit line through a set of points. However, LinRegTInt adds another method of checking the quality of the fit, by calculating a t confidence interval for the slope b. If the confidence interval calculated contains zero, the data supplied is insufficient to conclude a linear relation between the variables.

To use LinRegTInt, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. You do not have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command.

You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they are L₁ and L₂.

You can supply a confidence level probability as the fourth argument. It should be a real number between zero and one. If not supplied, the default value is .95. (95% confidence level) If you need to specify a different confidence level, you must enter the names of the lists as well, even if they're L₁ and L₂.

Finally, you can enter an equation variable (such as Y₁) after the command, so that the line of best fit is stored to this equation automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last.

For example, both

:{4,5,6,7,8→L₁
:{1,2,3,3.5,4.5→L₂
:LinRegTInt


and

:{4,5,6,7,8→X
:{1,2,3,3.5,4.5→Y
:{1,1,1,1,1→FREQ
:LinRegTTest ∟X,∟Y,∟FREQ,.95,Y₁


will give the following output:

LinRegTInt
y=a+bx
(.69088,1.0091)
b=.85
df=3
s=.158113883
a=-2.3
r²=.9897260274
r=.9948497512


(the last two lines will only appear if diagnostics have been turned on - see DiagnosticOn)

• The first line shows the confidence interval containing the slope of the fitted line; as mentioned above, if the interval contains 0, it cannot be concluded that the two variables have a linear relationship. Also, the smaller the difference between the two numbers, the more precision that can be attributed to the calculated slope.
• df is the degrees of freedom, equal to the number of points minus two.
• a and b are the parameters of the equation y=a+bx, the regression line we've calculated
• s is the standard error about the line, a measure of the typical size of a residual (the numbers stored in ∟RESID). It is the square root of the sum of squares of the residuals divided by the degrees of freedom. Smaller values indicate that the points tend to be close to the fitted line, while large values indicate scattering.
• r² and r are respectively the coefficients of determination and correlation: a value near 1 or -1 for the former, and near 1 for the latter, indicates a good fit.

# Related Commands

Command Summary

Divides one number by another.

Command Syntax

value1 / value2

Menu Location

Press the [/] key to paste /.

This command works on all calculators.

1 byte

The / operator divides two numbers, variables, or expressions. It has higher priority than + and -, so it will be done before them; it has the same priority as *.

:x/y
x/y
:2/2
1


Though division by zero isn't allowed, it will not cause an error; instead it returns the value undef — short for "undefined." Dividing by a variable that hasn't been defined yet will cancel it if it occurs on both sides: 5*x/x will equal 5; a short warning will be given to the effect that this isn't valid for x=0.

• - (subtract)
• * (multiply)
• + (add)

# See Also

Command Summary

Returns the multiplication of two numbers.

Command Syntax

value1 * value2

Menu Location

Press the [*] key to paste *.

This command works on all calculators.

1 byte

The * operator multiplies two numbers, variables, or expressions. In many cases, it's implied — 5x, for instance, will be assumed to be 5*x. There are two exceptions: long variable names — xy will be interpreted as a single variable, not as x*y — and function calls — f(x) will be interpreted as f() applied to x, not as f*x.

Multiplication has higher priority than + and -, so it will be done before them; it has the same priority as /.

:x*y
x*y
:2*2
4


# Advanced Uses

Multiplying matrices is not the same as multiplying their individual elements (which the .* operator does). To multiply two matrices, the first must have the same number of columns as the second has rows. The product of an MxN matrix with an NxP matrix will be an MxP matrix, whose (a,b)th entry will be the dot product of the ath row of the first matrix with the bth column of the second.

# Error Conditions

240 - Dimension mismatch happens when the dimensions of two matrices don't match up for multiplication to work.

• - (subtract)
• + (Add)
• / (divide)

# See Also

Command Summary

Returns the difference of two numbers.

Command Syntax

value1 - value2

Menu Location

Press the [-] key to paste -.

This command works on all calculators.

1 byte

The - operator subtracts two numbers, variables, or expressions. Order of operations dictates that it's calculated after * and /, and at the same time as +.

The - operator can also be used on lists and matrices. For the most part, it behaves in the intuitive way, distributing the operation over each element. However, subtracting a number from a matrix (or a matrix from a number) behaves differently: the number is only subtracted along the main diagonal of the matrix. For "normal" subtraction that applies to every element of the matrix, see .-.

:1-1
0
:5→x
:2-3x
-13
:[1,2;3,4]-100
[-99  2]
[3  -96]


• + (add)
• * (multiply)
• / (divide)

# See Also

Command Summary

Returns the sum of two numbers.

Command Syntax

value1 + value2

Menu Location

Press the [+] key to paste +.

This command works on all calculators.

1 byte

The + operator adds two numbers, variables, or expressions together. Order of operations dictates that it's calculated after * and /, and at the same time as -.

The + operator can also be used on lists and matrices. For the most part, it behaves in the intuitive way, distributing the operation over each element. However, adding a number to a matrix (in either order) behaves differently: the number is only added along the main diagonal of the matrix. For "normal" addition that applies to every element of the matrix, see .+.

:1+1
2
:5→x
:2+3*x
17
:[1,2;3,4]+100
[101  2]
[3  104]


• - (subtract)
• * (multiply)
• / (divide)

# See Also

 Oct 26 — Manual-Fit command is first created. Only two commands left to go…

Command Summary

Allows user to create a line of best fit and modify it

Command Syntax

Manual-Fit {Function}

Menu Location

Under Statistics or Catalog

1. Press STAT
2. Go to CALC
3. Press ALPHA D (or scroll to bottom)

TI-84+/SE (OS 2.30 or greater)

2 bytes

This command will allow the user to create a line of best fit according to their judgment. Activate the command by just pasting it on the screen. Then, click on a point for the line to begin followed by an end point. The calculator will then draw your line and display its equation at the top left corner of the screen. You can modify it by selecting the equation part and pressing enter. Input your desired value for the calculator to change it. The equation is stored into Y₁. If you specify what equation you want to store it to, then it will store to that function.

:Manual-Fit
(this activates the command and stores to Y₁
:Manual-Fit Y₃
(this stores to Y₃ instead)


One note about this is that it only graphs linear models. It is written in the form y=mx+b, and you can modify m or b.
Exit out by 2nd QUIT.

# Advanced Uses

This command is able to function in a program, but you cannot modify the values. This is a unique form of gathering user input that stores into the specified Y= function. Of course, this draws a line across the graph screen. You can then convert the function into a different form, like this:

:Manual-Fit
:Equ▶String(Y₁,Str1


This will turn the equation the user drew into a string which can then be used for output or calculations.

# Related Commands

 Oct 25 — Timothy Foster creates polynomial division routine

Routine Summary

This program will divide two polynomials of any positive integer degree.

Inputs

L1- Dividend
L2- Divisor

Outputs

L3- Quotient coefficients in descending degree

Variables used

L1, L2, L3, A, B, D

Calculator Compatibility

TI-83/84/+/SE

Author

Timothy Foster

Download

polydiv.8xp

:DelVar L₃
:For(A,1,dim(L₁)+1-dim(L₂
:L₁(A)/L₂(1→L₃(A
:For(B,2,dim(L₂
:L₃(A)L₂(B
:-Ans+L₁(A+(B-1→L₁(A+(B-1
:End
:End
:ClrHome
:For(A,dim(L₁)-(dim(L₂)-2),dim(L₁
:L₁(A→L₃(1+dim(L₃
:End
:Disp "FIRST TERM
:Output(2,1,"X^
:Output(2,3,dim(L₁)-dim(L₂
:Output(3,1,L₃


This routine will solve polynomial division with any given integer degrees. The dimension of L1 is the degree+1 of the dividend polynomial, and the dimension of L2 is the degree+1 of the divisor. The numbers used in the list are the coefficients of the respective polynomial in descending degree order, including place holder 0's. So, a polynomial of 3x3+2x2-1 would need to be {3,2,0,-1}. The program outputs the code as L3 in that form. The program also displays the degree of the first term. Once you reach the x0 term, all the coefficients afterward are the remainders. So, a display of X^2 {3,2,1,5,3} says 3x2+2x+1 and a remainder of 5x+3.

The program first asks for input. It asks for the degree of each polynomial, and then it asks for the contents using a For( loop until there are no more terms. It then commences with the main loop which is another For( loop. The program works in very much the same way people would go about solving a division problem. It divides the current leading terms of the dividend by the first term of the divisor and puts it into L3, our answer. It then does a second For( loop multiplying the partial quotient by every term of the divisor. At the end, it discovers the remainder in L1 and stores them into the end of L3 for a complete answer.

Here are a couple of examples for you to try out to see if the code was inputted correctly:

(1)
\begin{align} {x^2+3x-2 \over x+1} = x+2- {4 \over x+1} \hspace{12pt} \{ 1,2,-4 \} \end{align}
(2)
\begin{align} {x^4+3x^2-2x+1 \over x^2+4x+6} = x^2-4x+13-{30x+77 \over x^2+4x+6} \hspace{12pt} \{1,-4,13,-30,-77\} \end{align}

# Error Conditions

• ERR: INVALID DIM occurs if the degrees are made negative or the divisor's degree is larger than the dividend
• ERR: DIVIDE BY 0 happens if the leading coefficient of the divisor is 0
• ERR: DATA TYPE is thrown if anything is imaginary
 Name: Line 2.0 Author: graphmastur Download: line.zip Compatibility: Parent page not set File Size: 16384 (app) This program will take the graphscreen and turn it into recallable lines.
 Author: {$author} File Size: {$size} {description}  Name: Number Words Challenge Author: patriotsfan Download: NW.zip Compatibility: Parent page not set File Size: 1339 bytes Converts any number between 0 and 10001 into words. Routine Summary Calculates the standard error associated with linear regression coefficients. Inputs L₁ - values of the independent variable L₂ - values of the dependent variable Outputs Ans - a 2-element list containing the standard errors Variables Used L₁, L₂, Calculator Compatibility TI-83/84/+/SE :2-Var Stats :LinReg(ax+b) :a√((r²ֿ¹−1)/(n-2)){1,√(Σx²/n)}  This routine computes the standard error (uncertainty) associated with the linear regression coefficients a and ba and σb, respectively) for the regression equation y=ax+b. Precisely stated, the true value of the coefficient a is expected to be within the interval a±σa, and similarly for b. The routine returns a two-element list; σa is the first element, and σb is the second element. If one prefers to use the function LinReg(a+bx) instead of LinReg(ax+b), the appropriate routine is: :2-Var Stats :LinReg(a+bx) :b√((r²ֿ¹−1)/(n-2)){√(Σx²/n),1}  (note that the meanings of σa and σb have now interchanged). In both routines, r², a, b, n, and Σx² are statistical variables. # Formulas For the fitting equation y=ax+b, (1) \begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \begin{align*} \sigma_a&=a\sqrt{\frac{\frac1{r^2}-1}{n-2}} \\ \sigma_b&=\sigma_a\sqrt{\frac{\Sigma x^2}{n}} \end{align*} \end{align} where n is the number of data points, r² is the coefficient of determination, and Σx² is the sum of squares of the independent variable values. # Error Conditions # Reference Lichten, William. Data and Error Analysis., 2nd. ed., Prentice Hall: Upper Saddle River, NJ, 1999.  Name: Clock Author: AJLitzau13 Download: TIBD02.zip Compatibility: Parent page not set File Size: No size given An analogous clock showing the date and digital time.  Author: Edward H File Size: No size given The string "IVXLCDMvxlcdmni" specifies the letters used in the numerals. The longer you make the string, the more digits the program can handle. To satisfy the program requirements, the string must have at least as many characters as "IVXLCDMvx"; everything else is extra digit support.  Name: Roman Numerals Author: Mapar007 Download: ROMAN.8XP Compatibility: Parent page not set File Size: No size given No description given  Name: The Matrix Author: builderboy Download: TIBD03.zip Compatibility: Parent page not set File Size: No size given This program consists of the "Matrix Effect"; random symbols falling down the screen. When you would press "ENTER", the words "THE MATRIX" would form in the middle of the page, before loading some dialog from the film.  Author: Xphoenix File Size: No size given Asks for the number of sides, then the number of rolls, then displays the outcomes. This is a featured article, which means it is one of the best articles available on TI-Basic Developer. A featured article not only is well-written, but includes everything about the topic, as well as references (if applicable). You can see more featured articles by going to the featured articles page. author: Mapar007 description: 'A simple, but fun mastermind game, running entirely on the graph screen.' arcade: '0' graphics: '0' platform: '0' puzzle: '0' rpg: '0' strategy: '1' sports: '0' casino: '0' board: '1' utility: '0' misc: '0' image: '/archives:mastermind-1-0/mastermind_img.JPG' download: mastermind10.zip size: '1115' unit: '1'  Name: Challenge Five: Numeral-Verbal Translator Author: Timothy Foster Download: TIBD05.zip Compatibility: Parent page not set File Size: 1500 bytes This program will convert any number from 0 to 99999.999 into its word form. Numbers with digits beyond the thousandths place are rounded in the program. The program is very fast, but as a result of incredible speed, it is large. Overall, a great program for writing checks and such.  Name: Number to word, yo. Author: Edward Hou Download: NUMWORD.8xp Compatibility: Parent page not set File Size: 934 bytes Returns any positive real number in English.  Name: ARC Author: 7thAce Download: ARC.zip Compatibility: Parent page not set File Size: 1377 Shoot with a power between 2 and 5 and hit the ship. The ListPages module does not work recursively.  Name: Phoenix 1.0 Author: Mapar007 Download: phoenix10.zip Compatibility: Parent page not set File Size: approx. 4500 bytes A VERY upgraded version of Mnemon with better interface and remembering utilities. As the TI-Basic Developer is the most complete resource on the TI-Basic, we have decided to take it upon ourselves to construct a portable version of the site. The digital resource will be designed to be printed, and so will be printer-friendly. Compiling a portable version of the site gives the following advantages: 1. It would supersede the current manuals TI have already released; 2. It would not be necessary to be connected to the internet to access this information; 3. A printed version means that even a computer is not necessary to access this information; 4. Saves internet usage by people not downloading pages all of the time. Unfortunately, the portable version of the site is not yet complete. But some parts of it have been compiled: The ListPages module does not work recursively. Although not all parts of the site have been compiled, we are still able to present the Portable Site at its current stage of development. There is also a PDF version (4.05mb). You may also like to view the discussion of the portable wiki — http://tibasicdev.wikidot.com/forum/t-69216/snap-an-idea-for-a-big-project  Oct 05 — James Kanjo created a framework for submitting solutions on the challenges page.  Name: Clock Author: James Kanjo Download: CLOCK.zip Compatibility: Parent page not set File Size: No size given Clock for the TI-83 and above. Includes date and built-in validation.  Author: James Kanjo File Size: No size given Asks for the number of sides on the die, then for the amount of throws. It includes validation too.  Author: No author given File Size: No size given No description given  Author: No author given File Size: No size given No description given  Oct 04 — James Kanjo finished upgrading the News, Did You Know…, Featured Article and Featured Command frameworks on the site. Now it is so much easier to add to these sections of the site, and is filled automatically. It also enables to display randomly selected DYKs, FAs and FCs. The featured commands are articles that represent the best TI-Basic Developer has to offer. A featured command meets all of the following requirements: • Well-Written — It is easy to read, flows smoothly, and does not have any spelling or grammatical errors. • Complete — It includes everything about the command, including theory, code examples, and screenshots, when appropriate. • References — If applicable, it lists the sources that were used in putting together the command. To nominate a command for being featured, add it to the list below. # Featured Command Candidates: • None so far… feel free to nominate one! # Featured Commands: The ListPages module does not work recursively. Sprites are small images displayed as part of a larger scene on the screen. The most common reasons to use a sprite are to display a picture which will be moved around or repeated multiple times as part of a pattern. "Tokenization" is the process whereby the characters that make up a command are replaced by a token — a number representing the command. …that displaying sprites to column coordinates divisible by 8 is faster than to other coordinates? …that setMode() and similar commands have an alternate "programmer's syntax"? …that strings are the fastest data type to access, given enough elements? …that the ok system variable checks if a dialog was cancelled? …that the 26 one-letter variables a-z are much smaller to access? …that the © character can be used to enter comments in programs? …that ending a variable name with an underscore _ will make solve() and cSolve() assume it's complex? …that you can treat strings as always-undefined variables in symbolic math? When it comes to releasing a program, you want to make sure your program gets all of the attention that it deserves. Piecewise expressions are a shortcut to handling conditions in math statements. They can be used for turning an If block or several such blocks into a single line, creating much smaller and faster code. A subprogram is a program called by another program, and is used when a task needs to be performed multiple times. The complete program is thus made up of multiple smaller programs that all work together. Statistics is a mathematical science pertaining to the collection, analysis, interpretation or explanation, and presentation of data. Optimization involves making programs as fast and small as possible. Speed is important because TI-Basic is slow, while size is important because the calculator has limited memory. The Menu( command displays a generic menu on the home screen, with up to seven options for the user to select from; you can create another menu and link to it, if you need more than seven options. This is the page that allows you to add excerpts of pages in the TI-Basic Developer. 83 Portal Featured Articles Featured Commands Other Add excerpt Add excerpt Add excerpt 68k Portal Featured Articles Featured Commands Other Add excerpt Add excerpt Add excerpt  {month} {$day} — {$description}

This is the page that allows you to notify the TI-Basic Developer community of any news related to the site.

If you have an announcement that needs to be heard, then please select the appropriate portal.

# 2017

The ListPages module does not work recursively.

# 2016

The ListPages module does not work recursively.

# 2015

The ListPages module does not work recursively.

# 2014

The ListPages module does not work recursively.

# 2012

The ListPages module does not work recursively.

# 2011

The ListPages module does not work recursively.

# 2010

The ListPages module does not work recursively.

# 2009

The ListPages module does not work recursively.

# 2008

The ListPages module does not work recursively.

# 2007

The ListPages module does not work recursively.

# 2006

The ListPages module does not work recursively.

# 2017

The ListPages module does not work recursively.

# 2016

The ListPages module does not work recursively.

# 2015

The ListPages module does not work recursively.

# 2014

The ListPages module does not work recursively.

# 2013

The ListPages module does not work recursively.

# 2012

The ListPages module does not work recursively.

# 2011

The ListPages module does not work recursively.

# 2010

The ListPages module does not work recursively.

# 2009

The ListPages module does not work recursively.

# 2008

The ListPages module does not work recursively.

# 2007

The ListPages module does not work recursively.

# 2006

The ListPages module does not work recursively.
 Oct 01 — James Kanjo added a choose a "random command" link to the sidebar…COOL!
 Sep 27 — Timothy Foster created the page TI-Nspire Programming.
 Sep 15 — James Kanjo upgraded the framework of the archives. Now it is even easier to add, update, rate and moderate programs!
 Sep 04 — burr, the founder of the site, has finished contributing to the site, and moved on to other projects. (see his goodbye here)
 Sep 04 — James Kanjo tagged the 25 remaining untagged redirect pages with the "redirect" tag
 Sep 04 — basickevin created the page artificial intelligence
 Sep 03 — RandomProductions created the page How the Calculator Works.
 Sep 01 — TI-Basic Developer has now existed for approximately two years. Thanks to all that made it a great year, and may the next year be even more successful and exciting.
 Jul 28 — burr did some reorganization and cleanup to the resources page.
 Jul 14 — Zaphod Beeblebrox created the page Text Sprites Reference
 Jul 08 — basickevin created the page alternate routines to promote the creation of new optimizations
 Jul 03 — burr and James Kanjo set up the framework for the new TI-Basic Developer archives
 Jul 01 — Mapar007 created the page Binary and Hexadecimal number system
 Jun 20 — Zaphod Beeblebrox changed the resources page to use the tabview
 Jun 13 — James Kanjo added an "Instant Messenger" routine to the programs page
 Jun 11 — James Kanjo created a "New Members" section on the 83 and 68k home pages
 Jun 06 — James Kanjo finished integrating the new infobox framework into all 324 command pages
 Jun 02 — burr updated the showcases page separating the programs by genre and using the tabview.
 May 24 — RandomProductions spruced up the user input page to be a bit more recent.
 May 18 — The development of the TI-Basic Developer site logo is complete, and has now replaced the previous site header.
 May 15 — James Kanjo has set up a new framework for infoboxes for the 68k portal of the site.
 May 10 — James Kanjo has set up a new framework for infoboxes for the 83 portal of the site.
 May 04 — krazyness initiated the development of the TI-Basic Developer site logo, to replace the current header.
 Apr 24 — DarkerLine has finished the first chapter of the Starter Kit, a tutorial for beginner programmers.
 Apr 23 — burr created a validation tutorial that covers how to approach validating user input.
 Apr 16 — burr added a file download to all of the routines and programs.
 Apr 12 — burr created a TI-Basic Sidebar for Mozilla Firefox for quick reference of the TI-83 commands when you are away from the site.
 Apr 02 — James Kanjo made the 83 & 68k pages automatically retrieve the first 5 news items from the old news section.
 Mar 30 — burr started the Featured Articles page that lists the best articles available on the wiki, along with changing the "Featured Article" section in the sidebar on the homepage into an include page.
 Mar 30 — burr started the downloads page, and added all of the 68k tutorials that he found on the Internet.
 Mar 27 — burr started a Did You Know… page with a list of premade DYK's, along with changing the "Did You Know…" section in the sidebar into an include page.
 Mar 25 — James Kanjo added a warning to the grouping section, which the TI-Basic community may have previously been unaware of.
 Mar 16 — Weregoose created two pages on the calculator's internal fonts. DarkerLine has already found these images useful on other pages.
 Mar 13 — DarkerLine added include pages which makes adding a new command page much easier. Go for it!
 Mar 08 — Socks started working on the TI-Basic Starter Kit. Feel free to contribute.
 Feb 23 — RandomProductions put screenshots on all of the date and time command pages.
 Feb 09 — burr created a portal page, which acts as a bridge between the TI-83 and 68k sections of the site, and is now the new homepage for the site.
 Feb 08 — DarkerLine started a tokenization page, detailing what tokenization is and how it impacts program size and optimization.
 Feb 02 — DarkerLine put together a calculators page, which provides a brief, but detailed look at the different calculators and their specifications.
 Feb 01 — DarkerLine started the key codes page, as well as the character codes page.
 Jan 31 — burr created 68k versions of all of the relevant system pages, which will hopefully minimize any ambiguity or uncertainty about where you are on the site.
 Jan 31 — DarkerLine added an errors page that lists all of the possible error messages that can occur, including the error numbers and their descriptions.
 Jan 29 — DarkerLine begins work on the 68k section of the site, creating the homepage, top navigation, command stub and the command index.
 Jan 29 — All commands have now been documented! Woo!
 Jan 26 — burr added an optimization walkthrough tutorial which takes a person through the literal process of optimizing a game.
 Jan 24 — DarkerLine broke up the text manipulation page into a few routine pages: highlighting text, wordwrapping text and marquee.
 Jan 09 — The zoom commands have been documented, finishing up all commands except for the finance ones.
 Dec 16 — The xLIB Guru has merged with this wiki, and its content has been added.
 Dec 13 — The page about user settings, along with its various subpages, is now complete.
 Dec 11 — burr created a Boolean logic page detailing what Boolean logic is and how you can use it in your programs.
 Nov 27 — DarkerLine finished writing the pages about the various variable types, and started on the [/settings] commands.
 Nov 24 — simplethinker started creating pages for the trigonometry and polar functions.
 Nov 22 — burr added tags to the majority of the pages; only the command pages are left.
 Nov 18 — DarkerLine started creating pages for the different variable commands.
 Nov 16 — DarkerLine finished creating pages for the individual math commands.
 Nov 06 — burr created a self-modifying code page explaining what self-modifying code is and how you can use it.
 Oct 18 — burr began to create individual routines pages, using the new routine template
 Oct 15 — alexrudd began to split up the math page into separate command pages.
 Oct 14 — burr created a downloads page with over 100 zip files to download.
 Sep 01 — TI-Basic Developer has now existed for approximately a year. May the next year be even more successful and exciting!
 Jul 26 — burr put together a Frequently Asked Questions (FAQ) list of common TI-Basic related questions that people ask.
 Jul 24 — burr made a Sitemap that has a hierarchical breakdown of the site for easy viewing.
 Jul 22 — burr started a Common Coding Pitfalls page, which lists several different examples of code that are syntactically correct, but do not produce the correct or desired results.
 Jul 01 — burr started a Code of Conduct page, which lays down some general conduct rules to follow when contributing to the wiki.
 Jun 27 — burr started a Glossary page, which has general definitions for several of the words that are used throughout the wiki.
 Jun 26 — burr created a Code Commenting page, which is extremely useful for those people who are working on multiple projects at the same time, and want to be able to come back to a project without all the stress of figuring out what everything is again.
 Jun 23 — burr finished updating the Subprograms page, so now the external and internal subprograms are explained in comprehensive detail.
 Jun 22 — Xphoenix added a general section to the Program Setup page, and also created two pages: Assembly Shells and Basic Builder.
 Jun 22 — burr started a Program Setup page in the same fashion as the Program Cleanup page. Program setup includes getting the home screen, graph screen, and variables ready so your program can use them.
 Jun 18 — DarkerLine finally finished the Statistics pages. He's going to go back and add complicated formulas no one understands sometime later.
 Jun 13 — DarkerLine started working on the Statistics pages like he said he was going to a month ago…
 Jun 03 — Xphoenix created pages for some of the Graph Screen commands.
 May 05 — Harrierfalcon optimized one of the examples on the Compression Techniques page by using the seq( command.
 Apr 30 — alexrudd added the xor and not( operators to the Logical Operators page.
 Apr 22 — burr started the Project Challenges page. After you have gone through the wiki and learned the commands, design theory, and game techniques, you can now test yourself and try your hand at making some programs.
 Apr 21 — burr started the Old News page, which is the archive place for all the old news and is kept for posterity sake.
 Apr 19 — A few more games have been added to the Programs page, including: Avalanche, Maze Walkthrough, Pong, and Tic-Tac-To. The programs are all available for download in case anyone wants to try them out on their calculator.
 Apr 15 — burr added a Wiki Conventions page that lays down some general guidelines about how to format page content. There's a similar Command Stub page for command pages.
 Apr 13 — thornahawk and Xphoenix added some more information about the Math commands.
 Apr 08 — burr started the Review Exercises page, which allows readers to test their comprehension and understanding of the information on the wiki.
 Mar 30 — The Wiki Tour was started, providing a general overview of the wiki and giving beginners some direction about using the wiki.
 Mar 26 — alexrudd began experimenting with internal page anchors, and has decided that we should try to integrate them into more pages.
 Mar 25 — DarkerLine started working on the Statistics Commands. These commands are extremely useful for anybody who has to take a statistics class.
 Mar 23 — burr updated the Contribute page with some guidelines to help beginners better use the wiki.
 Mar 15 — Harrierfalcon added Number Functionality to Custom Text Input.
 Mar 03 — burr started the Recursion page. Recursion is related to using subprograms to optimize a program, except the program calls itself instead of other programs.
 Feb 21 — DarkerLine decided we should give each command its own individual page, so that all the relevant information about that command can be put on one page. Be sure to check out the Command Stub to see how the information is organized.
 Feb 19 — burr started the Usability page. It offers some ideas to think about when designing a program, including preventing the user from hurting themselves and following the KISS principle.
 Feb 16 — alexrudd started a Deck of Cards page that should be helpful to anyone who is wanting to learn how to manage the cards in a card game (such as Blackjack).
 Nov 08 — alexrudd and DarkerLine are promoted to admins, so they are now able to do all of the admin-related things for the wiki.
 Oct 14 — burr started the Marketing page. It offers some solid suggestions on ways to market your programs to the community.
 Oct 10 — burr started the Writing Program Documentation page. Check it out if you are wondering why documentation is important and what things your program documentation should include.
 Oct 07 — Talks of merging the wiki with the Function Library forum occur, but they ultimately fall through because it is decided that the wiki already covers much of the same content and the forum quality isn't very good.
 Oct 06 — burr started the Look-Up Tables page. Look-up tables are commonly used to increase the speed of programs when speed is the primary need in the program. This is especially true if graphics or user input are involved.
 Sep 24 — burr started the Custom Text Input page. It shows a simple input routine, briefly explaining how custom text input works and how you can expand the functionality to suit your own purposes and needs.
 Sep 23 — alexrudd updated the Program Protection page, further refining the different ways to protect a program. In addition, some good discussion about program protection and whether it is appropriate occurred over at the UTI TI-Basic forum.
 Sep 23 — burr started the Program Clean Up page. After a program finishes running, it should clean up after itself. This involves restoring the respective screens, deleting variables, and some other things.
 Sep 22 — burr started the Optimizations page. The page details the many different optimizations that you can do to a program, organizing them into relevant and related categories.
 Sep 06 — The wiki is moved from Wikispaces to Wikidot for hosting because the look of the pages and editor is better, and it offers a lot more space for the wiki to grow and mature.
 Sep 01 — TI-Basic Developer wiki is started by burr using the content from his TI-Basic Developer guide as the foundation for the wiki.

# 2017

The ListPages module does not work recursively.

# 2016

The ListPages module does not work recursively.

# 2015

The ListPages module does not work recursively.

# 2014

The ListPages module does not work recursively.

# 2013

The ListPages module does not work recursively.

# 2012

The ListPages module does not work recursively.

# 2011

The ListPages module does not work recursively.

# 2010

The ListPages module does not work recursively.

# 2009

The ListPages module does not work recursively.

# 2008

The ListPages module does not work recursively.

# 2007

The ListPages module does not work recursively.

# 2006

The ListPages module does not work recursively.

…that

…that it is actually sometimes better to leave on the closing parentheses on the For( loop?

…that a memory leak is caused when you use a Goto/Lbl within a loop or If conditional (anything that has an End command) to jump out of that control structure before the End command is reached?

…that you can omit the closing parentheses, quote, square bracket, curly brace, etc. at the end of a command or function?

…that while using seq(, the calculator can still interpret keypresses and store them to getKey?

…that you can use tanh(E9X to compute the sign of X?

…that Line( has an optional fifth argument that, if zero, will erase the pixels on a line, and, on color calculators, will change the color of the line?

…that you can replace the "Done" message that appears after a program is finished running by placing an expression, some text, or just a quote on the last line of your program?

…that you can use rand( to create a time delay similar to the Wait command on the TI-84+CE?

…that you can use multiple text arguments at the end of one Text( command to write, for example, Text(R,C,"Score",S)?

…that you can draw with different plot marks using Pt-On(X,Y,#)?

…that you can save memory when displaying text by replacing words such as "If" and "Then" with the appropriate commands?

…that "0<X<10" will actually compare "0<X" first, and compares the result (0 or 1) to 10, so "0<X and X<10" should be used instead?

…that using ΔList( together with cumSum( will return a list with its first element removed?

…that there are 256 picture variables built-in to the TI-83+ calculator, even though the calculator only shows 10 picture variables?

…that you can enable the faster circle drawing flag on the TI-83/84/+/SE by placing {i after the last argument of the Circle( command?

…that you can get the home screen font on the graph screen (except on the regular TI-83) by placing a '-1' at the beginning of the Text( command?

…that you can get the number of digits of a number N to the left of the decimal point by using the formula 1+int(log(N)?

…that the smallest way to implement the distance formula is by using the R►Pr( command?

…that you can use the % symbol or sub( with one argument as a smaller replacement for multiplying by .01?

…that you can get rid of the run indicator on the TI-83/84/+/SE by using Text(-1,0,90," " on the graph screen and Output(1,16," " on the home screen?

…that you can run your TI-Basic program from an assembly shell by placing a colon (":") as the first line of your program?

…that you can store to the list element one past the last element to add it to the end?

…that the finance variables are the fastest variables to use, even faster than Ans?

…that the String►Equ( command is completely useless, and you can store a string into one of the equation variables just using the → (store) operator?

…that the fastest way to check for a whole number is the command not(fPart(?

…that you can compress a list of related numbers by combining them into integer and fraction parts?

…that the majority of the graphics commands are dependent upon the window dimensions, so you should always use a friendly graphing window to ensure everything shows up as you intended?

…that you can make subprograms that are contained inside the program itself, so that they can be called by the program whenever needed?

…that you can use SetUpEditor to UnArchive a list, but at the same time create the list if it doesn't exist?

…that you can get away with not having a colon or a new line after DelVar?

…that placing a Lbl after DelVar will make that Lbl literally disappear?

…that you can scroll the Pause command's optional argument to see it in its entirety?

…that the smallest (though not the fastest) way to shade the entire graph screen is Shade(Ymin,Ymax)?

…that pressing alpha in the program editor followed by up or down, you will scroll a whole page of program code?

…that pressing [2nd] [RIGHT] in the program editor will take you to the end of your current line, and [2nd] [LEFT] will take you to the beginning of that line?

…that TI added several new TI-Basic commands to the newer TI-84+/SE calculators?

…that you can use -E99 and E99 to represent -∞ and +∞ in many calculations?

…that a memory leak is caused when you use a Goto/Lbl within a loop or If conditional to jump out of that control structure before the End command is reached?

…that a Repeat loop will always loop at least once, regardless of whether the condition is true or false before entering the loop?

…that the arrow and DEL keys can actually be held down, which will cause the key to keep being repeated until it is released?

…that the key codes follow a simple pattern: a key is represented by putting its row and column together?

…that you can access the lowercase letters by using an assembly program to turn on the lowercase flag that the calculator uses for enabling lowercase letters?

…that the Horiz format will split the screen in half horizontally, with both the graph screen and home screen being shown at the same time?

…that the expr( command allows you to store an expression to a string and then execute the string?

…that the TI-83 series of calculators does implicit multiplication, so there is no need to ever use the * sign?

…that iPart( and int( will return the same answers for positive numbers, but int( will return an answer 1 less than iPart( for (non-integer) negative numbers?

…that lists are the only variable that you can give your own names to?

…that you can omit the closing parentheses, quote, square bracket, curly brace, etc. at the end of a command or function?

…that Finance under the Applications menu is really not an application at all?

This is the page that allows you to add a did you know to the home page of each section

# Challenge ? — No title given

No criteria given

Entries judged on the ?/?/?

# [{$forum_url} Challenge {$number} — {$title}] {$criteria}

Entries judged on the {$day}/{$month}/{$year}  Name: Pong Contest Author: Mapar007 Download: thpong.zip Compatibility: Parent page not set File Size: 669 bytes A simple game of "Pong"  Name: Trapped Author: builderboy Download: Trapped.zip Compatibility: Parent page not set File Size: 13,932 bytes You wake up to find yourself trapped in the center of a fiendish maze filled with mystery and enemies that want to eat you. A mysterious friend and long forgotten notes guide you through the maze. Find items, blow up walls, fight logical enemies, and above all, find the machine that will help you escape. This article is currently in development. You can help TI-Basic Developer by . {$extra}
This article is currently in development. You can help TI-Basic Developer by .
 Note that this page was written in 2009, and much of the content may be outdated. For now, it is recommended that you visit the Nspire forums if you have questions. Or see the TI Nspire Software Manual for full documentation. UPDATE: You can now visit the Nspire home page

The TI-Nspire is a unique calculator in the BASIC series. The calculator's programming system is remarkably similar to that of the 68k's hardware, but because the Nspire's internal core is different, it needs a section on its own. Unlike all the older TI versions, the Nspire does not have a home screen or a graph screen. Instead, the calculator runs on a document that has five applications: Calculator, Graph and Geometry, Spreadsheet, Notes, and Statistics. The programming operates under the Calculator application. Although the Nspire makes good use of form and screen resolution, the programming is very limited compared to older versions. This article is meant to give you a brief overview of the programming in the Nspire and how older versions are preferable if you want to program.

# The Nspire: Introduction

The Texas Instruments Nsipre is an upgraded version of all the other TI models. It uses very much the same type of formatting as the 89 family but does not have a CAS. When first observing the calculator, you will notice the keypad. It is highly different from any other calculator.

It has a very strange layout compared to the other TI graphing calculators. First, all the letters get their own buttons, making it a little easier to type. Also, it has a ctrl key rather than a 2nd key. It has a clicker key, menu key, catalogs, enter, and even a caps key. If you observe it long enough, it begins to resemble a keyboard. This is because the Nspire is designed to be like a computer in a way. It uses documents to store information. These documents hold information about anything you did within it, not just programs. You can choose to save it, or load different documents, a lot like a computer. Also, the Nspire utilizes a mouse type system. It replaces the arrow keys with one round button. It acts as the arrows, and as a way to move a mouse-like pointer across the screen. The Nspire is a transition of a calculator to a computer, yet held back enough to retain calculator status.

The second thing you would notice is the screen resolution. Very nice! The screen is much better than any other calculator in history. The screen displays curves very well, it graphs cleanly, it uses letters and other characters with different size (much like a computer font style), and it is bigger. Also, the screen has many different shades of gray. In using inequalities, the calculator can actually shade in the region instead of drawing lines that represent it, and it darkens regions of overlap. The screen is very nicely done.

The final most notable thing is you might get lost on where every function is. The calculator has a very different key layout, and it also has a different internal layout. You might have trouble finding where some of the functions are. This article does not discuss how to find different functions, but it discusses the programming attribute which is the main topic of this site. For finding various functions, visit the Catalog (the book button) or check your CD manual. It has loads of information you can use.

# Pros and Cons

The programming for the Nspire is very similar to the 68k series. However, the Nspire simply isn't part of it. For one thing, the Nspire has no graph screen, or even a home screen. Everything is formed with documents, problems, and pages. You can have a document, problems within that document, and pages within those problems. Even though everything within a document is connected in some way, the calculator doesn't seem capable of accessing other pages or problems without manual control. Because of this limitation, the calculator has no graphing commands. It lost commands like Pt-On( and Line(. Anything under the Draw category has been deleted. The Draw command was the basis of advanced graphics, so that means the Nspire cannot produce any games with any sort of graphics, even though its resolution is so many times better than that of older models.

Furthermore, the calculator has no home screen. Instead, it uses a very strict line by line layout. The calculator deals with an operation or command very systematically. Until the calculator completes an assigned command or operation, it will not let the user interfere. New inputs are automatically in a new line. This sounds a lot like other calculators completing operations without interruption. However, this becomes a huge problem when pertaining to programs. The Nspire does the same thing to programs; it doesn't allow user interference. That means that the calculator will not accept user input until the program is finished. That defeats the purpose of programs. If you can't input anything, what use is programing? It happens that the program accepts input before a program is executed, but not during. So, to make a program with the same effects of programs in 68k or 83 family BASIC, you have to create multiple programs that must each be individually accessed, which becomes incredibly cumbersome.

So, the calculator is terrible at programming. It can't produce graphics or advanced layouts, and it won't accept input. So what use is programing on an Nspire. Truthfully, if you want to program, don't get the Nspire. Simply put, there is no real way to work around these obstacles. However, the regular Nspire comes with an 84+ keypad. It has all the capabilities of a regular TI-84+. Thing is, even though the calculator has capabilities of using extreme resolution, the 84+ keypad doesn't utilize it. So it's still not all that good.

So what if I already have an Nspire? Don't worry. If it comes with the 84+ keypad, go ahead and use that to program. In any case, the Nspire is definitely superior in math. Through sacrifice of programing capabilities, it has gained many useful math tools. For example, it checks primes, has trigonometric functions like secant and cotangent, a newly optimized numerical solver, point plot er, geometry grapher, spreadsheets, and more. It even utilizes templates, so instead of writing a math equation like ((3+4)/(5(6+3))^4, the calculator can write it as $\left( {3+4 \over 5(6+3)} \right) ^4$ instead. The Nspire also can hold numbers way higher than 1E100. So, it is superior in math (which can be a real big help on math tests!), but not a good programming apparatus.

This article will further discuss the topic of programming on an Nspire calculator describing how to create programs, describe all the commands, ways to get input, ways around the major obstacles, and a game example in the end.

# Creating a Program or Function

To create a program, make sure you are in the Calculator application. Press Menu and go to 8. Then, press 1 and 1 again. A window will pop up prompting the name of the program. Put in the name, select the type (program or function) and press OK. Now, you are in the program editor and you can now create your program.

There is are differences between programs and functions. Depending on what you are doing with the program, you will want to select one of them.
Program Function
Return a result? No Yes
Can be used in an expression? No Yes
Can run in applications other than Calculator? No Yes
Can use all the commands? Yes No
Can use multiple variable types? Yes Yes
Can access global variables? Yes Yes
Can modify and create global variables? Yes No
Can call subprograms? Yes No
Can call functions? Yes Yes

A program is what the other calculators typically use. The function can be used inline in an expression, such as 5+func(7)-2. However, functions do not support most of the commands on this page.

## Format

The format of the TI-Nspire is a little more organized than the 83 series. The program editor keeps much the same format except it indents for every group of commands. For example, it indents If…Then blocks, While…EndWhile blocks, and others.

Define test(a,b)=
Prgm
If a=1 Then
…Disp 1
c:=5
ElseIf a=2 Then
…Disp 2
…While b>0
……b:=b+2c
……Disp b
…EndWhile
ElseIf a=3 Then
…Disp 3
EndIf
EndPgrm

Variables on the Nspire function in much the same way as 68k variables. A variable can be a string of letters. An undefined variable is italicized. For example, if the variable height was undefined, or had nothing stored to it yet, then on the calculator the variable would look like height. Defined variables are bolded, so if height was defined, it would appear as height. Commands are neither bold or italicized, and you cannot store information into them.

## Execution

To execute the program, go to the Calculator application. You must then type out the entire program name. Then, put parentheses with values that must be defined for the program within them. The syntax for the above would look like:

test(2,-3)

You could also select the program from the var button.

# The Commands

Most of the commands on the Nspire are the same or variations of the 68k commands. However, the Nspire lacks most graphical commands, and some variable commands are limited. Some commands require a Computer Algebra System, or CAS, so if your Nspire doesn't have CAS, many of the commands will not function.

There are a few commands for exclusive use in programming. These commands help direct how the program works so that it can complete various tasks. The commands are divided into categories based on their overall function.

## Define Variables

These commands have to do with the variables. Commands listed here will affect the way the program treats variables.

### Local

Local is a command that tells the calculator how to identify the variable that comes after it. Local tells the program to make the variable a temporary variable that only functions within the program itself. So, when you local a variable, that variable is only used within the program, and if that same variable is used anywhere else, you will find that it was not affected. Here is the syntax.

Local varname

The varname can be any variable name or type. This command is useful in the sense that it won't mess with your previous usage of the variable. If you want to use the variable name, but it is used in other programs and you don't want your program to mess it up, use local. If there is a case where you want the variable to be altered globally, then don't use local, and the calculator will treat it like any other number.

### Define

The command Define will allow you to use subroutines within a program. This command creates a new program or function within the program so that the subroutine can be used again. For it to work, you must have either Pgrm…EndPgrm or Func…EndFunc for it to work.

Define test2(x,y)
Pgrm
Disp x,y
EndPgrm

### Delete Variable

This command will delete a variable making it undefined. This command will not set a number equal to 0, but it instead changes the variable to become unusable until defined later with a store command.

DelVar height

This command would be good to use when cleaning up a program. If you don't want your variables to have values after a program finishes, use DelVar to reset the variables.

### Func…EndFunc and Pgrm…EndPgrm

These sets can be used to create subroutines when used with Define. Func…EndFunc will create a function whereas Pgrm…EndPgrm will create a program. Use these after a Define in order to create the program which can be defined later in the main program.

Define test2(x,y)
Pgrm
Disp x,y
EndPgrm

## Control

These are the main commands that will be used. The control commands control the flow of the program affecting what group of commands to activate or how many times to commence a group of commands.

### If

This is exactly like the If condition used in other BASIC languages. You put a condition after the If, and if the condition is true, the next line will be executed. If it is false, it will be skipped. Here is the syntax.

If height>0
height*widtharea

This is very, very useful in programming, if not essential. The If command makes games possible. It detects limits, exacts, and special circumstances, which can affect the reality of any program.

### If…Then…EndIf

In BASIC, this is the equivalent of the If:Then combination. A condition goes after the If. If the condition is true, everything after the Then until the EndIf will be executed. If it is false, the calculator will begin at the EndIf and execute those commands. Here is an example.

If h=3 Then
…3+3→a
a+hc
c/h+ah
EndIf
Disp h

In this example, if h is 3, then the number displayed will be 9. If h isn't three, then it will display any number that is not three. Again, this conditional command is highly valued in programming. This is a must in programming! This also determines limits and special instances, but this opens a new field of the programing.

### If…Then…Else…EndIf

We probably don't need to tell you that this is the same as in BASIC. In this, it is an If conditional followed by Then and Else. If the condition after the If is true, then everything after the Then will be executed, but everything after the Else will be skipped. If the condition was false, then everything after the Then is skipped, and everything after the Else is executed. Here is an example.

If a>b Then
…Disp "Yes"
Else
…Disp "No"
EndIf

In this code, if a is greater than b, the program will say "yes", otherwise, it will say "no". This command is very useful. It is an efficient way to test something, and then have the program do one thing or the other depending on its fallacy. This command control is a very good way to maneuver your program, and it is highly recommended that this be used.

### ElseIf…Then

This is a special form of the If…Then…Else…EndIf command. This command allows you to test multiple different options instead of only one. This command must come after an If…Then, and you may have a lot of ElseIf's. First, it will test if the first condition is true. If it is, everything after Then is executed, and the program goes to EndIf at the first ElseIf it encounters. If it is false, the condition after the next ElseIf is tested. It does this until all ElseIf conditions are tested or one is true, and the following commands are executed.

If a=1 Then
…Disp "a is one"
…4→c
ElseIf a=2 Then
…Disp "a is two"
…2→c
ElseIf a=3 Then
…Disp "a is three"
…8→c
EndIf

This code tests the value of a three times. First it finds if a=1. If it does, the text "a is one" will appear, and c will become four. Then, it proceeds after EndIf. If a is not one, then the next condition a=2 is tested. If a is two, then the text "a is two" is displayed and c becomes 2. This is how the ElseIf works.

The ElseIf is a lot like the If…Then…Else…EndIf. These two codes are the same.

 If a>6 Then …2h+3→c …a+2-h→d …Disp "Next move?" Else …Disp "You Lose" …Stop EndIf If a>6 Then …2h+3→c …a+2-h→d …Disp "Next move?" ElseIf a≤6 Then …Disp "You Lose" …Stop EndIf

### For…EndFor

This is a calculator loop. This command, when used as For variable,start,stop,optional increment, will start with start, store that into variable, and execute every command until it reaches EndFor. Then, the program will go back to For, and add optional increment to variable and does do until it reaches the number stop. After that, it will end the loop and start executing commands after EndFor. The optional increment is an optional input, and the program will assume it is 1 unless stated otherwise. Here is an example of a For loop in action.

For a,1,11,2
…Disp a2
EndFor

This code will display 1, 9, 25, 49, 81, and 121. This is because it starts with a as 1, then a as 3, then a as 5, and so on.

### While…EndWhile

This command is another type of loop. This loop requires a conditional after While. It loops for as long as that condition is true, and the loop ends when that condition becomes false. For the loop to be executed, the condition must initially be true. Also, make sure the variables within the condition change otherwise the loop will become infinite.

0→x
While x<5
…Disp x
x+1→x
EndWhile
Disp x

This loop will display 0, 1, 2, 3, 4, and then 5. The loop ends when x becomes 5, and it displays the numbers from 0 to 4 because the starting number is 0. While loops are essential to game creating or animation.

### Loop…EndLoop

This command creates an infinite loop. This type of loop requires no arguments and will not stop unless you insert a Stop, Exit, or Goto. To exit the loop, it is best to create conditionals within the loop to signify when to jump out of the loop.

0→x
Loop
…Disp x
x+1→x
…If x>5
…Exit
End
Disp x

This code displays the same thing as the While…EndWhile loop above. The only real difference is that with Loop…EndLoop, you can create a conditional within the loop where the While…EndWhile only checks the conditional at the EndWhile.

### Try…Else…EndTry

This command allows you to literally "try" a group of commands, and if they error out, the ones after Else are commenced. If an error occurs in the Try part, then the calculator recovers from the error and picks up at the Else.

DelVar b
Try
…6+bc //note that b is undefined
Else
…6+7→c
End
Disp c

The program displays 13. The program first needs to try 6+bc, but since b is undefined, the program errors. However, since it is in a Try block, it skips to the Else and tries 6+7→c which works. So, it displays c which is 13.

### ClrErr

This command clears the current error and sets the error system variable to zero.

### PassErr

PassErr will pass an error to the next level of a Try…EndTry block.

## Transfers

The transfer commands direct what a program does without the need of an input. These commands simply activate when executed and tell the program specifically what to do.

### Return

This command will exit out of a subroutine and progress directly back to the parent program.

### Cycle

The Cycle command acts like an early End in the program loop. When encountered, it immediately shoots back to the beginning of the loop. When the loop ends, it doesn't go to Cycle, but it instead goes to the correct End.

Local a
0→a
While a<10
…Disp a
a+1→a
…If a>5
…Cycle
a+1→a
EndWhile

This code displays 0, 2, 4, 6, 7, 8, and 9. What happens is a+1→a occurs twice thus making a+2→a. However, when a becomes greater than five, the second a+1→a does not occur because the Cycle makes the loop restart.

### Exit

This command will immediately exit the current loop you are in. So, it stops the loop and starts where the End is. This command is used to escape Loop…EndLoop's, but it can be used with For…EndFor and While…EndWhile. It requires no arguments.

0→x
Loop
…Disp x
x+1→x
…If x>5
…Exit
End
Disp x

### Lbl

This places a Label in a program. A label is like a flag or marker in a program that can be used as a location by which a program can go to using goto. Labels have a name after them, like Lbl here, When the program encounters a goto name, it starts looking for the label with that specified name. When it does, the program resumes at that point.

### Go to Lbl

This will create a Goto in the program that will send the program out to find the matching label. This can be used to jump entire sections of the program or be used as a loop.

Local a
randInt(1,2)→a
If a=1
Goto 1
Disp "Heads"
Stop
Lbl 1
Disp "Tails"

This is a simple coin program that uses Goto. First, a random number is stored to local variable a. If a is 1, then it is tails. The program encounters Goto 1 and so it goes to Lbl 1. From there, it finishes the program. If a is two, then Goto 1 isn't encountered, so it displays the Heads and stops.

### Stop

This command halts the program. That is all it does. When the program encounters this command, it will completely end the program wherever it is.

3:=a
Stop
Disp "How did you get here?"

This code stores 3 into a and ends. The code will not give any output at all. This is useful when you reach a point where the user inputs and ending command (other than ON) so you can use an If type statement to end the program immediately. Then, you can put stuff after it in case the user did not want it to stop. Stop is also redundant at the end of a program.

## I/O

### Disp

This command displays whatever comes after it on the screen. This is what you see when you run a program; it is what the calculator produces as a result of the internal commands and calculations. Simply, put whatever you want to show after the Disp. If you use quotations, it will display the literal text. If there are no quotations, then the calculator will attempt to solve the expression you put.

Disp ab+a
Disp "Hello"

This code will display the answer to ab+a and then display "Hello" after it. This command is needed unless you aim for the program not to tell the user anything. So use this command, because it is the only way to convey a message to the user.

### Request

Syntax: Request promptString, var[, DispFlag [, statusVar]] or Request promptString, func(arg1, …argn)[, DispFlag [, statusVar]]
Request gets numbers from the user. It pops up a dialog box with a message of your programmed choice. For example, a little program snippet:

Define reqprog()=
Prgm
Request "Enter a number:",number
If number=1 Then
(code)
EndIf
.
.
.
EndPrgm

### RequestStr

Syntax: RequestStr promptString, var [, DispFlag [,statusVar]]
Almost same thing as Request, but requests a string.

Define yourname()=
Pgrm
RequestStr "What is your name?",name
Disp "Hello, ",name
Disp "Your name is ",dim(name)," characters long."
EndPrgm

### Text

Syntax: Text promptString [, DispFlag]
Pops with a dialog box with a message and an OK button.

Define randprgm()=
Prgm
For i,1,5
strinfo:=”Random number “ & string(rand(i))
Text strinfo
Next
EndPrgm

## Mode

The mode commands are the ones that change the overall output and computing system of the calculator. This includes changing things from degrees to radians, and from rectangular to polar. Under normal circumstances, these commands would probably not be used unless you are making a math program.

# Gaining Input

Getting user input on the Nspire is rather difficult and highly limited. The main problem is that the only I/O command is Disp. Unlike the TI-83 series or 68k, the Nspire doesn't have Input, Prompt, or getKey. The lack of these three commands makes the programming fairly weak on the calculator even though it has dozens more capabilities. Rather, what TI has done, is they expect the user to input the variables before program execution, and that is typically the one and only way Nspire programs will receive input. The problem becomes the user not knowing what he/she is inputting.
With updates to the Nspire OS, Request and RequestStr have been added to the command list, which enables the input of data during program execution. Input is still limited, as you cannot build a menu as in the TI-83/84 series. In internal commands they have I/O message boxes (wizards) with scroll lists and multiple input for a command; unfortunately TI has not enabled the programming of such dialog boxes.

There are three ways to receive input. The first way is to simply have the user store desired values into all the variables before executing the program. For example, say that a program uses the variables width and height. The user can store what he or she wants to be the width or the height by using the syntax valueheight. If there is already something in the variable, then it would look more like valueheight. Then, the user can execute the program.

The second way exists within the reason for the ending parenthesis during execution. In the program editor, the programmer can go to the top line where the Define Program() is. Then, you put the variables you want defined in the parenthesis separated by commas. So, still using width and height, the top line would look like: Define Program(width,height). Then, the user types out the program name with the parenthesis, but instead of leaving the parenthesis blank, the user would put the values he wants to assign width and height in the parenthesis separated by commas.

The final way is a way to get input during a main program. Unfortunately, the only way to receive input mid execution is the completely stop the program and let the user activate another program (or the same one) with the new values. This of course is not all that user-friendly. It can also be frustrating having to redefine a program every time.

# Programming

In truth, the only real application for programs is the use of math and probability programs. Although the thought of games is conceivable, it would be futile to even attempt making something even like pong or another simple game. Even creating a guessing game is almost impossible. Even so, programming does have the application of helping you with your math or giving you an idea of likelihoods.

## Math Programs

Making a math program can be pretty useful. These programs are the ones that ask for an input and begin solving. This can be easy to program because most math programs only require one input at the beginning. One such program would be a quadratic equation solver.

To make a math program, you must first determine what you are solving for and what variables are being given. For our quadratic equation solver, we want the two roots, determinant, and vertex when inputting a, b, and c when ax2+bx+c=0. The user must input a, b, and c at the beginning of the program. Since that is the only input, this can be done easily. Define the program and put the variables within the parentheses.

Define quadratic(a,b,c)
Pgrm

EndPgrm

The next step is to plug in your formulas. We want the calculator to solve for the roots with one special condition: For two roots, it must display both roots and "Two Solutions", for one root, the answer and "One Solution", and when both roots are complex to display a solitary "No Solution". We must first find the determinant which will tell us how many solutions will result.

Define quadratic(a,b,c)
Pgrm
b2-4a*cd
EndPgrm

Now, we can add our conditionals with If…EndIf blocks.

Define quadratic(a,b,c)
Pgrm
b2-4a*cd
If d>0 Then
…Disp "Two Solutions"
…Disp $-b+\sqrt{d} \over 2a$
…Disp $-b-\sqrt{d} \over 2a$
EndIf
If d=0 Then
…Disp "One Solution"
…Disp $-b \over 2a$
EndIf
If d<0
Disp "No Solutions"
Disp "Determinant"
Disp d
EndPgrm

That finishes the program.

## Probability Programs

This is probably the most conceivable types of programs you can make on an Nspire. This would be the type of program where you experiment to define the likelihood of occurrences under certain conditions. This would be like spinning a spinner 1000 times or flipping a coin 25 times. These programs are easy to make because all you need is a random command and a For loop. For this program, we are going to say we need to spin a spinner 100 times where the blue section has a theoretical probability of 0.5, the yellow 0.25, and the red 0.25. First, define your program. The user doesn't need any variables defined, so we will just close the parentheses on the first line.

Define spinner()
Pgrm

EndPgrm

Now, we want to define our variables within the program, so we need to local them. We want our variables to be named blue, red, and yellow. Also, initialize them.

Define spinner()
Pgrm
Local blue
Local red
Local yellow
0→blue
0→red
0→yellow
EndPgrm

Next, we need to start the For loop. Since we want 100 trials, we will start at one and end at 100.

Define spinner()
Pgrm
Local blue
Local red
Local yellow
0→blue
0→red
0→yellow
For a,1,100

EndFor
EndPgrm

Now, use randInt() to find the color landed on. Since we are dealing with fourths, use numbers 1 to 4.

Define spinner()
Pgrm
Local blue
Local red
Local yellow
0→blue
0→red
0→yellow
For a,1,100
…randInt(1,4)→spin
EndFor
EndPgrm

Next, we need to set up each conditional so that if the variable spin is 1 or 2, blue goes up one, if it is 3, yellow is incremented, and if it is 4, red is incremented. We can use the ElseIf commands for this.

Define spinner()
Pgrm
Local blue
Local red
Local yellow
0→blue
0→red
0→yellow
For a,1,100
…randInt(1,4)→spin
…If spin<3 Then
……blue+1→blue
…ElseIf spin=3 Then
……yellow+1→yellow
…ElseIf spin=4 Then
……red+1→red
…EndIf
EndFor
EndPgrm

Now, the last step is outputting the results. Simply create a list of displays to show the number of spins.

Define spinner()
Pgrm
Local blue
Local red
Local yellow
0→blue
0→red
0→yellow
For a,1,100
…randInt(1,4)→spin
…If spin<3 Then
……blue+1→blue
…ElseIf spin=3 Then
……yellow+1→yellow
…ElseIf spin=4 Then
……red+1→red
…EndIf
EndFor
Disp "Yellow"
Disp yellow
Disp "Blue"
Disp blue
Disp "Red"
Disp red
EndPgrm

## Game Programs

The game program is very hard to accomplish in Nspire Basic. These types of programs will usually take more than one program to accomplish in order to accept more user input. However, a game such as "Guess my Number" can be done in one program.

The general strategy is to create a starter program that sets up the game. Then, every time user input is required, separate it into another program and leave a display telling what the next program is. For one program, initially start a global variable with a strange name so the program can recognize if you are starting a new game.

Here is a game where you have to guess a number between 1 and 100 in seven tries. First, you need to create variable gmn as 0. This variable will be our deciding number that finds what try you are on and whether a new game starts or not.

Create the program. Variable a will be the user guess.

Define guess(a)
Pgrm

EndPgrm

Define what happens if gmn is 0. The program stores a random number between 1 and 100 into b. Then, 1 is stored into gmn to represent guess 1.

Define guess(a)
Pgrm
If gmn=0 Then
…Disp "Guess a number between 1 and 100"
…Disp "Type guess( ) with the guess in the parentheses"
…randInt(1,100)→b
…1→gmn
…Stop
EndIf
EndPgrm

This next part says that if your guess, a, is larger than b to display guess lower. If it is smaller, guess larger. If a is equal to b, then it displays "You Win!" and the gmn resets to 0.

Define guess(a)
Pgrm
If gmn=0 Then
…Disp "Guess a number between 1 and 100"
…Disp "Type guess( ) with the guess in the parentheses"
…randInt(1,100)→b
…1→gmn
…Stop
EndIf
If a>b Then
…Disp "Lower"
ElseIf a<b Then
…Disp "Higher"
ElseIf a=b Then
…Disp "You Win!"
…0→gmn
…Stop
EndIf
EndPgrm

Finally, the program will check if you won or not. If the gmn variable (our turn keeper) goes higher than 7, the program ends and gmn is reset to 0.

Define guess(a)
Pgrm
If gmn=0 Then
…Disp "Guess a number between 1 and 100"
…Disp "Type guess( ) with the guess in the parentheses"
…randInt(1,100)→b
…1→gmn
…Stop
EndIf
If a>b Then
…Disp "Lower"
ElseIf a<b Then
…Disp "Higher"
ElseIf a=b Then
…Disp "You Win!"
…0→gmn
…Stop
EndIf
gmn+1→gmn
If gmn>7 Then
…Disp "You Lose."
…Disp "Answer was"
…Disp b
…0→gmn
EndIf
EndPgrm

# A Game Example

This game, called FighterX, is a test against the calculator to see how well of a guesser you are. It is a relatively simple program where all the user does is guess a number from 1 to 3. If you guess the number the calculator was thinking of, the calculator loses HP. Otherwise, you lose HP. Try to understand the code.

Program 1

Define fighterx()
Pgrm
100→you
100→calc
Disp "Are you ready?"
Disp "Type gs( ) with your guess in the ( ) to begin"
EndPgrm

Program 2

Define gs(g)
Pgrm
randInt(1,3)→gc
If g=gc Then
calc-randInt(5,13)→calc
Else
you-randInt(2,7)→you
EndIf
Disp "You"
Disp you
Disp "Calc"
Disp calc
If you<1 Then
…Disp "You Lose"
…DelVar you
ElseIf calc<1 Then
…Disp "You Win!"
…DelVar calc
EndIf
If you>0 and calc>0
Disp "Type gs( ) and guess again"
EndPgrm

# Break a Calculation

The Nspire version of the ON-Break is a little different than for the 83/84 series. For the Nspire, you must press and hold the On button and wait until it asks for confirmation. Then, you can break the calculation. This is useful in the event that an overly complicated function is being performed and you want the calculator to stop thinking so that you can do something else, without having to reset the calculator or remove batteries.

# Forum

To visit the TI-Nspire forum, click here. If you have any questions about the Nspire programming or calculator itself, please ask in the forums, and someone will help you as soon as possible.

# Further Research

You can discover much about the Nspire and its commands through the 68k portion of this site since they are quite similar.

This is where most of the magic happens, be it for math class or a game. While much can be accomplished on the Home Screen, it's nowhere near as versatile as the Graph Screen.

 Table of Contents

# Introduction

The most useful aspect of the Graph Screen is the variety of ways to create graphics. There are 95x63 adjustable pixels that can be modified with any of the Pxl-, Pt- or more specialized draw commands as well as a twist on Text. Unlike on the Home Screen where your coordinates are restricted to integers from 1-8 and 1-16, different window settings can be used to customize the coordinates of each point. You can switch points between 'on' and 'off', or just check to see if a point is 'on' (great for collision detection!).
(NOTE: The TI-84+ CSE and CE have a bigger screen, so the pixel dimensions are 320x240. However, the adjustable pixels are 264x164 (X by Y). Keep those last dimensions in mind when you program for either the CSE or CE calculators.)

# Pictures

Pictures include anything that can be created on the Graph Screen from the Draw menu, but not any functions or graphs.

## StorePic

StorePic allows you to save the current picture from the Graph Screen and can be accessed from the STO sub-menu
by pressing [2nd][Draw][Left][Enter]. This can be useful if you have a frequently used picture or a background that you don't want to have to continuously redraw. Within TI-Basic there are 10 picture variables, which are numbered 0 through 9.
For example, if you wanted to store the current picture to Pic1 you would do:

:StorePic 1


## RecallPic

RecallPic is used to display a previously saved picture. It can also be found in the STO sub-menu. The one thing to remember when using this command is that it will draw the picture on top of what is already on the Graph Screen instead of completely replacing it. This means that it will turn on any pixels that are on in the picture, but will not turn off pixels that are off in the picture. An easy way to circumvent this is to use ClrDraw before recalling the picture.
If you wanted to display Pic1 you would do:

:RecallPic 1


# Graph Databases

A Graph Database contains the window and format settings, functions, and the settings of FUNC/PAR/POL/SEQ, CONNECTED/DOT, and SEQUENTIAL/SIMUL from the Mode menu.

## StoreGDB

Just like with StorePic, StoreGDB is used to store the current graph database settings. It can be found in the STO sub-menu. There are 10 GDB variables, which are numbered 0-9.
To store to GDB1 you would use:

:StoreGDB 1


## RecallGDB

Incredibly, RecallGDB is used to recall a saved graph database! Luckily this does not have the problem of RecallPic. If one setting has a value that's not the same as the saved value, then it's changed to the saved value.
To recall GDB1 you would use:

:RecallGDB 1


# Things To Come

In the following sections of this chapter you'll learn different ways to manipulate pixels, how to use the various draw commands and the effects that 'simple' text can have in order to create truly awesome games!

When you compile a basicbuilder app, any delvar command will not delete the variable. But, there is a way to delete the variable using two assembly programs celtic2 and Zrun. First you have to specify all of your delvar commands in Str9 like:

"Delvar ADelvar BDelvar C"→Str9

Now for the Code:

"TEMP"→Str2
"1234567890"→Str1
1→A
Repeat Str9≠"..P:NT:FN"
Str2+(Str1,A,1)→Str0
0→θ
asm(prgmCELTIC2
A+1→A
End
1→θ
asm(prgmCELTIC2
asm(prgmZRUN


Routine Summary

Retrieves the key code of any key pressed

Calculator Compatibility

TI-83/84/+/SE

:Repeat Ans
:getKey
:End
:Disp Ans


This routine loops until a key is pressed. When a key is pressed, the key code for that specific key is displayed.

The ListPages module does not work recursively.
 Getting Involved A site can only grow and thrive through the continual efforts of its members. If you have found this site useful, we encourage you to contribute and become part of our community. Sign-ups are available, and our forums are open to questions, commentary, or anything else that you want to talk about. We hope to see you there!
 Forum Activity 1: This is a dead thread. The last post was from September of 2016. It is unlikely that anyone... (by Myles_Zadok 23 Feb 2018 03:32, posts: 10) yes, Steps are available for ALL math and science subjects, check www.ti-nspire-cx.com The trials... (by Calculus Made Easy 23 Feb 2018 01:21, posts: 10) It seems like you may need to GarbageCollect. I have had this same problem 5 months ago, Garbage... (by Bio_Hazard1282 22 Feb 2018 18:24, posts: 2)
 Did You Know... The ListPages module does not work recursively.
 Featured Article The ListPages module does not work recursively.
The ListPages module does not work recursively.
 Getting Involved A site can only grow and thrive through the continual efforts of its members. If you have found this site useful, we encourage you to contribute and become part of our community. Sign-ups are available, and our forums are open to questions, commentary, or anything else that you want to talk about. We hope to see you there!
 Forum Activity 1: This is a dead thread. The last post was from September of 2016. It is unlikely that anyone... (by Myles_Zadok 23 Feb 2018 03:32, posts: 10) yes, Steps are available for ALL math and science subjects, check www.ti-nspire-cx.com The trials... (by Calculus Made Easy 23 Feb 2018 01:21, posts: 10) It seems like you may need to GarbageCollect. I have had this same problem 5 months ago, Garbage... (by Bio_Hazard1282 22 Feb 2018 18:24, posts: 2)
 Did You Know... The ListPages module does not work recursively.
 Top Rated Programs The ListPages module does not work recursively.
 Featured Article The ListPages module does not work recursively.
 Featured Command The ListPages module does not work recursively.

As a way to test your comprehension of the information, and to ensure that you actually read through the information instead of merely skimming over it, we have provided review exercises. These exercises provide a way of helping you apply the information, so that you get a fuller understanding of the concepts. Highlight the area next to the word answer for the answer.

1. True or False: The ClrHome command should be used at the end of a program, to ensure that the program does not leave any leftover text on the home screen.

Answer:

2. What type of variable cannot hold a complex number?

Answer:

3. Which of the following uses of the Disp command returns an error?

1. Disp
2. Disp ""
3. Disp "Hello World
4. Disp "Hello","World
5. None of the above
Answer:

4. Which draw command cannot be called from a program?

Answer:

5. What is the difference between the iPart( and int( commands?

Answer:

6. True or False: Programs can use the home screen for everything they can do on the graph screen.

Answer:

7. What is the minimal modification that will allow this code to start-up?

:Menu("Choose One,"Menu Item",1,"Menu Item",2
:Lbl A
:Pause "Item 1
:Stop
:Lbl 2
:Pause "Item 2

1. Add a closing quote on the menu title.
2. Remove the Stop command.
3. Change Lbl A to Lbl 1.
4. Add a closing quote on the menu title and change Lbl A to Lbl 1.
Answer:

8. In a statistics class, the teacher asks the students to generate a list of 100 random numbers. Unfortunately, the exercise doesn't work as intended because 22 students, in a class of 30, get the exact same numbers (using different calculators). What's a likely explanation for this surprising coincidence?

Answer:

9. How many digits of accuracy does the TI-OS have? How many can it display on the screen?

Answer:

10. The Output( command can display text at any place on the screen, but what happens when the text goes past the end of the line?

1. Nothing. The text simply does not show up.
2. An error is returned.
3. The text will wrap around to the next line.
4. An ellipsis will be displayed at the end of the line, with the rest of the text not being displayed.
Answer:

11. True or False: You need to use a Pause command before clearing the screen, otherwise the user will only see the text on the screen for a couple seconds; it will be a blur.

Answer:

12. When is using the Menu( command appropriate, and even desired? (Choose the best answer.)

1. If you want a generic menu.
2. Your program is going to be text-based.
3. It is the most practical menu available in your situation.
4. You want your program to stand out, so you need a fancy menu.
Answer:

13. What would be the effect of replacing a Disp command with an Output( command and vice verse? Give any instances where this switch might be useful. Also, when would you use Disp in conjunction with Output?

Answer:

14. What is the maximum dimension of a list?

Answer:

15. Which one statement is true about this code?

:Menu("","",B,"",B
:Disp "Test
:Lbl B
:Disp "Pizza
:Output(1,1,"Spaghetti

1. An error will be returned when the Menu command is executed.
2. The program will execute, but there will not be any text displayed.
3. The "Test" text will be displayed along with the "Pizza" and "Spaghetti" text.
4. The "Pizza" and "Spaghetti" text will be displayed, but not the "Test".
Answer:

16. True or False: Before using the Menu( command, you need to clear the home screen, otherwise you will have text interrupting the menu.

Answer:

17. Consider the following code:

:0:Menu("Difficulty","Easy",3,"Medium",2,"Hard",1
:Lbl 1:Ans+1
:Lbl 2:Ans+1
:Lbl 3:Ans+1


The Ans variable keeps track of the last answer, often being used in place of more permanent variables. If the user selects the "Hard" menu item, what will Ans's value be? What effect does the label ordering have on the value, if any? Why?Answer:

18. True or False: Using the home screen is faster than using the graph screen?

Answer:

19. Which of the following cannot be used to test if a variable is any of 1, 2, 3, or 4?

1. If sum(A={1,2,3,4
2. If (A=int(A))(A>=1)(A<=4)
3. If A={1,2,3,4}
4. If A(int(A)=A)(A<5)
Answer:

20. True or False: The following is an alternate to using the or operator.

:If (X=1)+(X=2

Answer:

21. Name a command or function that cannot be interrupted by pressing the [ON] key.

Answer:

22. For which of the following would not(B) not equal 0?

1. .01→B
2. 0→B
3. π→B
4. -4→B
Answer:

23. True or False: The following is an alternative to using the and operator.

:If Anot(B

Answer:

24. How many bytes is an uppercase character? A lowercase character?

Answer:

25. Which of these user-created list names are actually possible on the calculator?

1. L1234
2. LBaDd
3. Lθθθθ
4. LABCD
Answer:

26. What type of variable needs a special command to store to it?

Answer:

27. Change this short program so it doesn't flicker and then optimize it as much as possible.

:0→X:0→Y:Repeat 0
:ClrHome
:Output(Y,X,"X")
:getKey→K
:If K=24:X-1→X
:If K=25:Y+1→Y
:If K=26:X+1→X
:If K=34:Y-1→Y
:End

Answer:

28. True or False: You can archive another program from within a program.

Answer:

29. What is the maximum length of a string?

Answer:

30. Which of the following variables is it possible to archive?

1. Y1
2. prgmKEWLGAME
3. the real variable T
4. the real variable A
5. L_RESID
6. L1
Answer:

31. Without trying it first, is this legal?

:[A]L4([A]([A](L1(1),L2(1)),L1(1(L2(2L3

Answer:

32. How would you find the fifth element from the last in a sequence of 20 elements?

Answer:

33. What will this code do?

:DelVar B1→A
:If A:If B
:Disp "Hello World

Answer:

34. How do you get rid of the Done message at the end of a program?

Answer:

35. Write a program that inputs a string and outputs the letters backward, one per line.

Answer:

36. Will this code execute?

:If 0:Disp "Your turn
:Else:Disp "Guess not

Answer:

37. What is the simplest program you can have that has recursion?

Answer:

38. Which of these are logically equivalent?

1. not(P or Q)
2. P and Q
3. not(P and Q)
4. not(P) or not(Q)
5. not(P) and not(Q)
Answer:

39. True or False: There are actually 256 picture variables on the calculator, even though only 10 picture variables show up.

Answer:

40. What are the differences between Assembly and TI-Basic? When would you use Assembly and when would you use TI-Basic?

Answer:

41. How long will the program go through the loop until it stops execution?

:0→X
:While X
:Disp "Another Loop
:X+1→X
:If X=25
:Stop
:End

Answer:

42. What is wrong with this code?

:If X=25 Then
:Disp "X is 25
:X+1→X
:Disp "X is now", X
:End

Answer:

43. What are the only keys that can actually be held down, causing them to be repeated?

Answer:

44. How would you go about converting a list to a matrix? What would the code look like?

Answer:

45. True or False: There is no built-in way to convert a string to a number.

Answer:

 Author: burr File Size: No size given Asks for the number of sides on the die, then asks for the number of rolls. And, of course, it displays the numbers rolled.
 Name: Hash 2X Author: Bxsciencer (aka Jason Lee) Download: Hash2x.zip Compatibility: Parent page not set File Size: 1356 bytes This is a multivariable hash function that I created. Its pretty fast (especially on a computer), and can have outputs of any size greater than 8 (any less is ridiculously insecure, although a simple edit to the program will allow for any output size greater than 0). However, due to the limitations of the 83/84, 256 is the max inputs and outputs for the moment. The outputs are stored in Str1, so they can be recalled. There has been no editing of anything except for the files included in this download. PS. Any help in analyzing this algorithm is most welcome and greatly appreciated.

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

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


# Why This Works

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

:4→A:8→B


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

:Repeat K=21


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

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

:getKey→K


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

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


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

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


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

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


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

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

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

:Output(A,Ans,"X


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

:End


And thus we have the full movement code.

# Graph Screen

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

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


Author

Program Description

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

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

Unavailable

Program size in bytes

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

Routine Summary

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

Inputs

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

Outputs

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

Variables Used

L₁, L₂, L₃, θ

Calculator Compatibility

TI-83/84/+/SE

Author

Galandros

URL: United TI

Download

listfrequency2

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


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

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

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

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

The ListPages module does not work recursively.

{$tutorialsBegin} Besides reading the programming information that this wiki provides, there are several additional quality TI-Basic tutorials that other people have created that you might find handy. Name Author Complete TI-Basic Optimization Guide Arthur O'Dwyer 1337 Guide to TI-Basic Jonathan Pezzino & Kerm Martian Making TI-Basic Shells Patrick Stone 2D TI-Basic Sprites Alex Snyder Advanced Thinking Fred Sparks No-Lib Guide to Sprites and Maps Thomas Dickerson TI-Basic Greyscale Kevin Ouellet TI-Freakware Tutorials Daniel Thorneycroft Complete TI-Basic Tutorial Kerm Martian BASIC Guru Tutorials Ben Ilegbodu MJS 2000 Tutorials Unknown Rogue's TI-86 Basic Tutorial Andrew Matta HeaneySoft BASIC Tutorial Wayne Heaney TI-83 Programming Tutorials Lue Her & Andy Becker TI-Basic for Noobs Matt Lee {$tutorialsEnd}

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

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

{$emulatorsBegin} An emulator allows you to run a virtual form of your calculator on your computer, which is very convenient when you want to make quick changes to programs, or do any debugging or optimizing. Name Author TI-83 TI-83+ TI-83+SE TI-84+ TI-84+SE TI-84+CSE TI-84+CE Emu8x Michael Vincent X Flash Debugger Texas Instruments X X TilEm Benjamin Moody & Solignac Julien X X X X X PindurTI Patai Gergely X X VTI-Alpha Corey Taylor & Rusty Wagner X X VTI-Beta Rusty Wagner X X WabbitEmu (WIN) Spencer Putt & James Montelongo X X X X X X WabbitEmu (MAC) Spencer Putt & James Montelongo X X X X X X jsTIfied Christopher Mitchell X X X X X X O {$emulatorsEnd}

{$related-sitesBegin} There are many TI sites out there, providing their own set of services and features. {$related-sitesEnd}

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

Command Summary

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

Command Syntax

Output row,col,text

Menu Location

Starting in the program editor:

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

This command works on all calculators.

2 bytes

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

:Output 20,20,"Hello, world"


# Advanced Uses

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

# Related Commands

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

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

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

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

## On for the Very First Time

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

## Off? Try Sleep

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

## Crashed Calc!

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

## Final Notes on Calculator RAM

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

# Introduction

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

# Characteristics of AI

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

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

## Acquire

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

## Analyze

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

## Action

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

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

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

# Understanding AI

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

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

# Prerequisites

## Logic

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

# Components

## Thinking like AI

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

## Conditionals

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

## Probability

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

# Methods

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

## MiniMax

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

## Decision Tree

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

## Self-Learning

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

# Conclusion

work in progress

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

Routine Summary

Returns the sum of digits of a number.

Inputs

X - the number you want

Outputs

Ans - the sum of X's digits

Variables Used

X, Ans

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

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


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

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

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


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

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

# Related Routines

 Name: Chemical Equation Solver Author: Edward Hou Download: ChemEq1.0.zip Compatibility: Parent page not set File Size: 928 bytes Balances chemical equations, inputted as a string.

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.