` ``Input "Code:",Str0 Expr("{"+Str0→L₂ //code for converting L2 {118,101,141,121} into the desired list L1 {3,1,20,19} "?" For(A,1,dim(L₁ Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ ",L₁(A),1 End sub(Ans,2,length(Ans)-1→Str1`

The input would be exactly:

118,101,141,121

Since I didn't write your code, its hard for me to follow. Therefore, you will have to modify either your code or my code to work for your needs. If there is anything you don't understand about my code, please let me know.

]]>Try using this code with this specific input:

3,1,20,19,27,13,5,15,23

Don’t split the input, dont use spaces. Just type it exactly as I typed it, and then press enter

` ``Input “CODE:”,Str0 expr(“{“+Str0→L₁ "?" For(A,1,dim(L₁ Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ ",L₁(A),1 End sub(Ans,2,length(Ans)-1→Str1`

` ``0.1→L Repeat fPart(L=0 length(Str3)/4→L If not(fPart(L=0 Str3+" →Str3 End`

OK, so here's EXACTLY what I did in my original program's test run:

1.) Ran prgmSECRET

2.) Selected "ENCODE"

3.) Typed in "CATS"

4.) The four numbers it gave me in return: {118 101 141 121}

5.) Ran prgmSECRET again

6.) Selected "DECODE" this time

7.) Typed "4" when prompted with "NUMBER OF CHARACTERS?"

8.) Entered list: {118 101 141 121}

9.) The four numbers it gave me in return: {3 1 20 19}

Using the final four numbers it gave me, I ran this code from a new program:

` ``" " For(A,1,dim(L₁ Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ ",L₁(A),1 End sub(Ans,2,length(Ans)-1→Str1`

And it STILL gave me "ERR:DOMAIN"

]]>The following code is the addition….

Just end the code after that. Then type L1 on your home screen. If you have any values less than 1 or greater than 27, your code won't work. If that is the case, you could use the multiplicative inverse of your coding matrix to decode the message, then use the matrix>list command and the list>string routine.

I'm not 100% sure if this will work, but instead of the person writing the message having to add spaces, you could use:

` ``0.1→L Repeat fPart(L=0 length(Str3)/4→L If not(fPart(L=0 Str3+" →Str3 End`

in place of

]]>:If fPart(A/2)≠0

:Then

:Disp "ERROR: ADD SPACE"

:Stop

:End

Second, that says "0→θ"

Here's my code WITH the addition:

` ``:0→θ :0→dim(L₂ :0→dim(L₃ :0→dim(L₄ :0→dim(L) :{2,2}→dim([B] :6→[B](1,1) :5→[B](1,2) :7→[B](2,1) :6→[B](2,2) :"ABCDEFGHIJKLMNOPQRSTUVWXYZ →Str1 :ClrHome :Menu("FUNCTION","ENCODE",1,"DECODE",2) :Lbl 1 :Disp "MESSAGE" :Input Str3 :length(Str3)→A :If fPart(A/2)≠0 :Then :Disp "ERROR: ADD SPACE" :Stop :End :{2,A/2}→dim([A] :For(N,1,length(Str3 :inString(Str1,sub(Str3,N,1),1)→O :If N≤.5length(Str3 :Then :O→[A](1,N) :End :If N>.5length(Str3 :Then :O→[A](2,N-.5length(Str3) :End :End :[B]*[A]→[C] :Matr►list([C]ᵀ,L₁,L₂) :augment(L₁,L₂)→L :Disp L₁ :Stop :Lbl 2 :1→V :ClrHome :Disp "NUMBER OF" :Disp "CHARACTERS" :Input F :{2,F/2}→dim([D] :Lbl 5 :1→M :If V>F :Then :Goto 6 :End :Disp "NUMBER" :Input J :If V≤.5F :Then :J→[D](1,V) :End :If V>.5F :Then :J→[D](2,V-.5F) :End :V+1→V :Goto 5 :Lbl 6 :[B]⁻¹*[D]→[E] :Matr►list([E]ᵀ,L₃,L₄) :augment(L₃,L₄)→L₁ :Disp L₁ * The following code is the addition that does NOT work (it says "ERR:DOMAIN" * :Pause :Menu("CONVERT TO ABC?","YES",8,"NO",9) :Lbl 8 " " For(A,1,dim(L₁ Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ ",L₁(A),1 End sub(Ans,2,length(Ans)-1→Str1 :Disp Str1 :Lbl 9 :Stop`

Additionally, I see a few bugs/typos/idk in your code.

- In the beginning, you store 0 in 0, which makes no sense. Did you mean a O?
- I haven't typed up your code, but there is probably a way to use fewer lists/matrices. If you no longer need a list stored, you can replace its values with a new list's values. Same with matrixes.
- You don't need a clear home before the menu.
- Your code exits if you type something up wrong, which could be frustrating for someone trying to use it. I'd recommend using a goto to go back to the place where you typed up your message instead of a stop exiting the program.

` ``:0→Θ :0→dim(L₂ :0→dim(L₃ :0→dim(L₄ :0→dim(L) :{2,2}→dim([B] :6→[B](1,1) :5→[B](1,2) :7→[B](2,1) :6→[B](2,2) :"ABCDEFGHIJKLMNOPQRSTUVWXYZ →Str1 :ClrHome :Menu("FUNCTION","ENCODE",1,"DECODE",2) :Lbl 1 :Disp "MESSAGE" :Input Str3 :length(Str3)→A :If fPart(A/2)≠0 :Then :Disp "ERROR: ADD SPACE" :Stop :End :{2,A/2}→dim([A] :For(N,1,length(Str3 :inString(Str1,sub(Str3,N,1),1)→O :If N≤.5length(Str3 :Then :O→[A](1,N) :End :If N>.5length(Str3 :Then :O→[A](2,N-.5length(Str3) :End :End :[B]*[A]→[C] :Matr►list([C]ᵀ,L₁,L₂) :augment(L₁,L₂)→L :Disp L₁ :Stop :Lbl 2 :1→V :ClrHome :Disp "NUMBER OF" :Disp "CHARACTERS" :Input F :{2,F/2}→dim([D] :Lbl 5 :1→M :If V>F :Then :Goto 6 :End :Disp "NUMBER" :Input J :If V≤.5F :Then :J→[D](1,V) :End :If V>.5F :Then :J→[D](2,V-.5F) :End :V+1→V :Goto 5 :Lbl 6 :[B]⁻¹*[D]→[E] :Matr►list([E]ᵀ,L₃,L₄) :augment(L₃,L₄)→L₁ :Disp L₁ *Nothing after this point is part of the original code* :Pause :Menu("CONVERT TO ABC?","YES",8,"NO",9) :Lbl 8 *This is where I want the code that converts the string of numbers to letters* :Disp *blank* :Lbl 9 :Stop`

The code will first "encode" a small message, then give you a list of numbers. These numbers can be plugged back into the program using the "decode" option and it will give you another list of numbers, but these correspond to the letters of the alphabet. (I should also mention: if the word you're encoding has an odd number of letters, you're required to add a space somewhere [I just put it at the end] when typing your message. This means there's technically an addition to the alphabet, which the code just puts as 27.)

To answer your question, Trenly, I typed in your code and it worked fine.

]]>What happens when you run the code I posted?

]]>` ``{1 2 3 4 5 6 7 8}`

Or is it

` ``{12345678}`

Because how this works is it relates each number with a point in the string and retrieves that letter.

Otherwise, make sure you typed everything correctly.

]]>I put the numbers 1, 2, 3, 4, 5, 6, 7, & 8 in L_{1} and still got an error message……?

So… short answer it works now.

]]>` ``seq(I,I,26,1,-1→L₁ "?" For(A,1,dim(L₁ Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",L₁(A),1 Pause Ans End sub(Ans,2,length(Ans)-1→Str1`

You will need to press output after each step, but that code should have no errors and should produce:

` ``?Z ?ZY ?ZYX ?ZYXW ?ZYXWV ?ZYXWVU ?ZYXWVUT ?ZYXWVUTS ?ZYXWVUTSR ?ZYXWVUTSRQ ?ZYXWVUTSRQP ?ZYXWVUTSRQPO ?ZYXWVUTSRQPON ?ZYXWVUTSRQPONM ?ZYXWVUTSRQPONML ?ZYXWVUTSRQPONMLK ?ZYXWVUTSRQPONMLKJ ?ZYXWVUTSRQPONMLKJI ?ZYXWVUTSRQPONMLKJIH ?ZYXWVUTSRQPONMLKJIHG ?ZYXWVUTSRQPONMLKJIHGF ?ZYXWVUTSRQPONMLKJIHGFE ?ZYXWVUTSRQPONMLKJIHGFED ?ZYXWVUTSRQPONMLKJIHGFEDC ?ZYXWVUTSRQPONMLKJIHGFEDCB ?ZYXWVUTSRQPONMLKJIHGFEDCBA ZYXWVUTSRQPONMLKJIHGFEDCBA`

If you get no errors with that snippet of code, that means that whatever values you have in L1 are the issue, and not the code ]]>

` ``" " For(A,1,dim(L₁ Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",L₁(A),1 End sub(Ans,2,length(Ans)-1→Str1`

But for me, this code actually returns a domain error. IDK why. ]]>

The second does the reverse, it takes a number from the list, finds the indicated position in the alphabet, and adds the letter in said position to the string.

Look at string-to-list or list-to-string for more info

]]>` ``" " For(A,1,dim(L₁ Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",L₁(A),1 End sub(Ans,2,length(Ans)-1→Str1`

Basically, you start with a string with any character at the beginning ("space" in this case), loop through for each number in the list and add that character to the string, then remove the extra character at the beginning of the string. ]]>

` ``"WORD→Str1 seq(inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",sub(Str1,A,1)),A,1,length(Str1→L₁`

Thanks! ]]>