Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 803 Bytes

PigLatin.md

File metadata and controls

19 lines (13 loc) · 803 Bytes

Pig Latin

Write some code that translates a string (word, sentence, or paragraph) into “pig-latin” using the following rules.

  • Words that start with a consonant have their first letter moved to the end of the word and the letters “ay” added to the end.
  • Words that start with a vowel have the letters “way” added to the end.
  • Words that end in “way” are not modified.
  • Punctuation must remain in the same relative place from the end of the word.
  • Hyphens are treated as two words
  • Capitalization must remain in the same place.
  • Single letters are not modified.

Example Input

"HeLLo World! I can't wait to explore your VAST forests. The-End!"

Example Output

"ElLOhay Orldway! I antca'y aitway otay exploreway ouryay ASTVay orestsfay. Hetay-Endway!"