| Pig
Latin Notes Fall 2006, David Matuszek |
When becomes Enwhay. cat's becomes at'scay. 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.
opstay could mean either stop or tops,
and there's no way to choose between them.hay, discard those letters. For example, aracterchay
becomes haracterc (oops--oh, well.) ay and move one consonant to the front, so opstay would
become tops; or ay, move them to
the front, and drop the ay. So opstay would
become psto (oops again!) w and y as consonants.
y as
a vowel when it's at the end of a word.sky in Pig Latin becomes yskay.
(This can even be decoded correctly, back to sky.) sky or Mrs. or gzzph),
probably the best thing to do is to just add hay to the
end.