I have a TI-84 Plus, and I am creating a program to calculate the magnitude of an n-dimensional vector. I have included my code and its output below.
Program Editor:
PROGRAM:NTHDMAG
Disp "HOW MANY DIMENSIONS?"
Prompt N
{X,Y,Z,T,A,B,C,D,E,F,G,H,I,J,L,M,P,U,V,W}->L1
For(K,1,N,1)
L1(K)->Q
Prompt Q
End
Output Display:
pgrmNTHDMAG
HOW MANY DIMENSIONS?
N=?3
Q=?1
Q=?2
Q=?3
Done
I want the Q's to be replaced with each letter in L1, and indexing L1(K) in the Prompt command throws an error. The values for the L1 letters will be whatever the value of each component is (so here, for example, 1i + 2j + 3k).
I hope this is clear, but I am more than willing to clarify if it is not. Thank you for any help that you can provide!
This may be what you're trying to do,
Input
is used instead ofPrompt
, allowing us to choose the string. The string is built by taking a single-letter substring from"XYZTABCDEFGHIJLMPUVW"
and then appending"=?"
to it, making it look just likePrompt
, of course this is easy to change. It's SourceCoder syntax so|L
means that strange small ∟ for list names. Does not work if list T is archived, it could be made to work but IMO it should not, usually an archived list means the user wants to keep it.It's much easier to let the user enter a list themselves though, for example
This allows more convenient user input such as
Rcl
(of a whole list) and list operations, for example:Or perhaps more typical:
But
N
is not explicit.Leaving the result in
Ans
is probably useful. Implicitly printing by evaluating a value instead of a proper command on the last line gets rid ofDone
which isn't that useful, but it's something you can do.