Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create TI-BASIC (TI-84+) input forms?

Tags:

basic

ti-basic

In the TI-BASIC programming language (Specifically TI-84+), how do you create input forms, such as the ones included in the default apps on the TI-84+.

The image included here shows an example of what I'm trying to create: A menu that you can scroll through and input multiple variables freely before executing a function

Additionally, is it possible to make this menu dynamically-updating as variables are entered?

like image 825
Psifrost Avatar asked Feb 26 '15 05:02

Psifrost


2 Answers

You've set a rather tall order for TI-Basic to fill. user3932000 is correct; there is no built in function to create an input form of the type you request.

However, there is nothing stopping you from creating an interactive interface yourself. Creating it from scratch will be a time consuming and, it will consume a significant amount of memory on your calculator. There is no boilerplate code you plug your variables into to get the results you want, but you might have some luck modeling it after this quadratic solver I wrote.

ClrHome
a+bi
Output(1,1,"    QUADRATIC
Output(2,1,"    AX²+BX+C
Output(3,1,"ZEROS:
Output(6,1,"A=
Output(7,1,"B=
Output(8,1,"C=

DelVar YDelVar D
"             →Str1

While Y≠105
getKey→Y

If Ans
Then
Output(X,4,Str1
Output(3,7,Str1+Str1+Str1+"   
End

X+(Ans=34)-(Ans=25
If Ans<6:8
If Ans>8:6
Ans→X

Output(Ans,16,"◄

D(Y≠45→D

If Y=25 or Y=34
sum({A,B,C}(X={6,7,8→D

If Y=104:⁻D→D

10not(Y)+Y(102≠Y)-13int(Y/13(2>abs(5-abs(5-abs(Y-83
If Ans≤9
D10+Ans-2Ans(D<0→D

If X=6:D→A
If X=7:D→B
If X=8:D→C

If A
Then
2ˉ¹Aˉ¹(⁻B+{1,⁻1}√(B²-4AC
Else
If B
Then
⁻C/B
Else
If C
Then
"No Zeros
Else
"All Numbers
End
End
End

Output(3,7,Ans
Output(6,3,A
Output(7,3,B
Output(8,3,C
End
ClrHome
Ans

Here's a GIF of what it does for you.

With a little more work. This code could be used on the Graph screen instead of the home screen, giving more option in terms of layout and design.

like image 142
ankh-morpork Avatar answered Sep 30 '22 07:09

ankh-morpork


In the TI-BASIC programming language (Specifically TI-84+), how do you create input forms, such as the ones included in the default apps on the TI-84+.

There are many ways to ask for input in your program:

  • Prompt: Asks for input and stores it in a variable. For example, Prompt A. Simplest way to ask for input, but not very visually appealing.

  • Input: Similar to the Prompt command, except that now you can include text within the input. For example, Input "What is your name?",A.

  • Menu(: Multiple choice input, and each choice is connected to a Lbl marker somewhere else in the script. Much like the error screen with the quit/goto choices that you've probably seen. For example, Menu("Are you a boy or a girl?","Boy",B,"Girl",G).

  • getKey: Checks if a certain key is pressed, and will output True (1) if that key is pressed. For example, getKey 105. See here for which numbers each key corresponds to.

The image included here shows an example of what I'm trying to create: A menu that you can scroll through and input multiple variables freely before executing a function http://imgur.com/ulthDRV

I'm afraid that's not possible in programs. You can either put in multiple inputs, or you might be interested in looking into making apps instead.

Additionally, is it possible to make this menu dynamically-updating as variables are entered?

If you're talking about the text on top of the screenshot, yes you can; just put a Disp command or something after each line of Input, so that it continuously overwrites the text above with new text after you input a variable.

like image 40
user3932000 Avatar answered Sep 30 '22 07:09

user3932000