Fall 2006, David Matuszek
Yes, he spent $1000!!!becomes
Esyay, ehay entspay $1000!!!
Correct programs do not, of course, get into infinite loops. If you are not careful, and if you write your program a certain way, it might get into an infinite loop when it encounters a word with no vowels. Just be sure to test for this case.
opstaycould mean either
tops, and there's no way to choose between them.
hay, discard those letters. For example,
ayand move one consonant to the front, so
ay, move them to the front, and drop the
yas a vowel when it's at the end of a word.
skyin Pig Latin becomes
yskay. (This can even be decoded correctly, back to
gzzph), probably the best thing to do is to just add
hayto the end.