- Main
read in a phrase
while the phrase is valid
Encode the phrase
Print the results.
read in a phrase
- EncodePhrase
For each letter in the phrase
add the encoding of the letter to the code phrase
return the code phrase.
- EncodeLetter
If the letter is an alphabetic letter
if the letter is upper case
convert the letter to lower case
Reflect the letter
If the original letter was upper case
change the reflected letter to upper case.
return the reflected letter
else
return the original letter
- ReflectLetter
if the letter is m or lower
subtract the letter's position relative to a from z
else
subtract the letter's position relative to m from n
return the results.