Daily Challenge #36

Pig Latin Language :grin:
Create a program that converts a word into PigLatin.

How it should work:

  • A procedure that takes an input and returns a result
  • Input should contain atleast 2 words
  • If input doesn’t include vowels, or minimum 2 words, return itself (error)
  • For each word
    o Move all letters before 1st vowel to end of word, then add “ay” to end of word
  • Return converted words

Examples:

  • doPigLatin(graphic please) → aphicgray easeplay
  • doPigLatin(graphic) → graphic (error case - only 1 word)
  • doPigLatin(good night) → oodgay ightnay
3 Likes

Shouldn’t the result be aphicgray easeplay?
Taifun

1 Like

Taifun, you are right. Seems like I don’t speak pig latin :slight_smile: I’ll fix the initial post

2 Likes

Making an update to the challenge to make it easier:

All lower case
Only 1 word

doPigLatin(graphic) -> aphicgray
doPigLatin(please) -> easeplay

2 Likes