TI-BASIC is the programming language used on Texas Instruments graphing calculators. There are different versions for different model calculators.
Code Snippets[]
TI-83+/84+ version of TI-BASIC[]
"Hello World" program[]
:Disp "Hello, World!" :Stop -- Program description -- :Disp "Hello, World!" displays "Hello, World!" on the calculator's screen :Stop forces the execution to end
Or
:Lbl 1 :Disp "Hello, World!" :Goto 1 -- Program description -- :Lbl 1 Marks this point in the program as label "1" :Disp "Hello, World!" displays "Hello, World!" on the calculator's screen :Goto 1 returns execution to label "1", in this case, causing the program to loop
Note that the second program above will loop infinitely until execution is broken by pressing the [ON] button on the calculator.
Counting program[]
:1→X :Lbl 1 :X+1→X :Disp X :Goto 1 -- Program description -- :1→X stores "1" to variable "X" :Lbl 1 Marks this point in the program as label "1" :X+1→X Takes variable "X", adds 1, then stores the result to variable "X" :Disp X Displays the current value of variable "X" :Goto 1 returns execution to label "1", in this case, causing the program to loop
Note that program above will loop infinitely until execution is broken by pressing the [ON] button on the calculator.