List
From TI-BASIC Wiki - The free TI-BASIC encyclopedia
Lists (sometimes called Arrays in other languages) are structures that can hold up to 99 individual values. In TI-84-BASIC, Lists can only store Real or Complex values. In TI-89-BASIC, Strings as well as Real and Complex values can be stored in lists.
Lists can be dimensioned in this format:
:{number1[,number2,...,numberN]}
To change an individual item in a list, the following consturct is used:
(84) :number→listName(position) (89) :value→listName[position]
To access an individual item in a list, the following consturct is used:
(84) :listName(position) (89) :listName[position]
The size of a list can be accessed using the dim( command.
Contents |
[edit] Variables
[edit] TI-89
In TI-89, like all variables, any variable name can store a list.
[edit] TI-84
[edit] Default
L1 - L6 found on the keypad.
[edit] Defining Lists
Custom lists can be difined in TI-basic. They all start with the L character, and can consist of up to 5 additional characters.
:LALIST
[edit] Use in programs
[edit] High Score Lists
One use for lists in game programs is to create a custom list and save high scores onto it. You can do this by adding it to the list and then deleting the extra at the bottom. (after the list is sorted)
In code, for LSCORE of size 10 and new score S, this is:
:11→dim(LSCORE) :S→LSCORE(11) :SortD(LSCORE) :10→dim(LSCORE)
! This article is a stub. Please help the TI-BASIC Wiki by expanding it
