DECLARE SUB printmorse (Theword$) DECLARE FUNCTION GetAnswer$ () DECLARE FUNCTION lettertomorse$ (letter$) CLS DO PRINT "Which word do you want to translate?" word$ = GetAnswer$ printmorse (word$) LOOP UNTIL word$ = "1" FUNCTION GetAnswer$ PRINT "Your answer is: " LINE INPUT theAnswer$ PRINT "You typed: "; theAnswer$; USING "&&"; PRINT " " GetAnswer$ = theAnswer$ END FUNCTION FUNCTION lettertomorse$ (letter$) SELECT CASE LCASE$(letter$) CASE "a" lettertomorse = "._" CASE "b" lettertomorse = "_..." CASE "c" lettertomorse = "_._." CASE "d" lettertomorse = "_.." CASE "e" lettertomorse = "." CASE "f" lettertomorse = ".._." CASE "g" lettertomorse = "__." CASE "h" lettertomorse = "...." CASE "i" lettertomorse = ".." CASE "j" lettertomorse = ".___" CASE "k" lettertomorse = "_._" CASE "l" lettertomorse = "._.." CASE "m" lettertomorse = "__" CASE "n" lettertomorse = "_." CASE "o" lettertomorse = "___" CASE "p" lettertomorse = ".__." CASE "q" lettertomorse = "__._" CASE "r" lettertomorse = "._." CASE "s" lettertomorse = "..." CASE "t" lettertomorse = "_" CASE "u" lettertomorse = ".._" CASE "v" lettertomorse = "..._" CASE "w" lettertomorse = ".__" CASE "x" lettertomorse = "_.._" CASE "y" lettertomorse = "_.__" CASE "z" lettertomorse = "__.." CASE ELSE lettertomorse = " " END SELECT END FUNCTION SUB printmorse (Theword$) FOR inx = 1 TO LEN(Theword$) letter$ = MID$(Theword$, inx, 1) code$ = lettertomorse$(letter$) PRINT letter$, code$ NEXT END SUB