{VERSION 4 0 "SUN SPARC SOLARIS" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "This worksheet sets up a s imple correspondence between the alphabet and numbers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 107 "The followi ng list contains the alphabet and space, represented by _. The funct ion translate_to_numbers()" }}{PARA 0 "" 0 "" {TEXT -1 123 "will take \+ a list of letters, find the letter in ordered_alphabet[], and return t he appropriate index: 1 for A, 2 for B etc." }}{PARA 0 "" 0 "" {TEXT -1 76 "Note that I started the list with \"_\" and have to subtract 1 \+ to get 0 for _." }}{PARA 0 "" 0 "" {TEXT -1 160 "The function translat e_to_letters() is simpler. Given a list of numbers, all between 0 an d 26, it returns the letter ordered_alphabet[N+1] for the number N. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 131 "This is easy to rewrite to accomodate punctuation marks, or whatever chara cters you want to include (and whatever indexing system)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 102 "ordered_alphabet := [_, A, B, C, D , E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%1ordered_alphabetG7=%\"_G%\"AG%\"B G%\"CG%\"DG%\"EG%\"FG%\"GG%\"HG^#\"\"\"%\"JG%\"KG%\"LG%\"MG%\"NG%\"OG% \"PG%\"QG%\"RG%\"SG%\"TG%\"UG%\"VG%\"WG%\"XG%\"YG%\"ZG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 279 "translate_to_numbers := proc(let_l ist)\nlocal i,j, num_list;\n\nnum_list := [];\nfor i from 1 to nops(le t_list) do\n for j from 1 to nops(ordered_alphabet) do\n if let_li st[i] = ordered_alphabet[j] then\n num_list:= [op(num_list),j-1] ;\n fi;\n od;\nod;\nRETURN(num_list);\nend;" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%5translate_to_numbersGR6#%)let_listG6%%\"iG%\"jG%)num _listG6\"F,C%>8&7\"?(8$\"\"\"F3-%%nopsG6#9$%%trueG?(8%F3F3-F56#%1order ed_alphabetGF8@$/&F76#F2&F=6#F:>F/7$-%#opG6#F/,&F:F3F3!\"\"-%'RETURNGF HF,F,F," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 197 "translate_to_le tters := proc(num_list)\nlocal j, let_list;\n\nlet_list :=[];\nfor j \+ from 1 to nops(num_list) do\n let_list:= [op(let_list), ordered_alpha bet[num_list[j]+1]];\nod;\nRETURN(let_list);\nend;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 12 " " 1 "" {XPPMATH 20 "6#>%5translate_to_lettersGR6#%)num_listG6$%\"jG%)l et_listG6\"F+C%>8%7\"?(8$\"\"\"F2-%%nopsG6#9$%%trueG>F.7$-%#opG6#F.&%1 ordered_alphabetG6#,&&F66#F1F2F2F2-%'RETURNGF " 0 "" {MPLTEXT 1 0 63 "b_let := [T,H,E,_,C,A,T,_,I,S,_,O,U,T,_,O,F,_ ,T,H,E,_,B,A,G,Z];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&b_letG7<%\"TG %\"HG%\"EG%\"_G%\"CG%\"AGF&F)^#\"\"\"%\"SGF)%\"OG%\"UGF&F)F/%\"FGF)F&F 'F(F)%\"BGF+%\"GG%\"ZG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "b _num := translate_to_numbers(b_let);" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#>%&b_numG7<\"#?\"\")\"\"&\"\"!\"\"$\"\"\"F&F)\"\"*\"#>F)\"#:\"#@F&F) F.\"\"'F)F&F'F(F)\"\"#F+\"\"(\"#E" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "translate_to_letters(b_num);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7<%\"TG%\"HG%\"EG%\"_G%\"CG%\"AGF$F'^#\"\"\"%\"SGF'%\"O G%\"UGF$F'F-%\"FGF'F$F%F&F'%\"BGF)%\"GG%\"ZG" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 381 "When you have finished working you can save it in 3 (! ) different ways. The following will save the data created above as r egular text (in Maple language) to a file named \"simpletext\". The q uotes are only necessary if you use certain characters, but I'm playin g it safe. You can then edit the file \"simpletext\" using a text edi tor. When you start a new session use the command " }}{PARA 0 "" 0 " " {TEXT -1 19 ">read \"simpletext\";" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "save ordered_alphabet, tr anslate_to_numbers, translate_to_letters, \"simpletext\";" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 197 "The following will save everything in the worksheet to the fi le \"simpletext.m\" in internal Maple format, so it will only be read able by Maple not by a text processor. You can read it in using" } }{PARA 0 "" 0 "" {TEXT -1 20 ">read \"simpletext.m\"" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "save \"si mpletext.m\";" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 66 "Finally, you can save the whole worksheet using the me nu File:Save" }}{PARA 0 "" 0 "" {TEXT -1 70 "Then when you want to reo pen the worksheet you use the menu File:Open" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "15 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }