New exercise: pig-latin

This one was a lot of fun. Once you understand that the rules can be broken down into two branches:

  • Word starts with vowel, xr or yt (append “ay”),
  • Word starts with consonant, qu counts as one consonant, y after consonant counts as vowel (vowels before consonant, append “ay”),

a simple finite state machine allows you to collect the indices you need to construct the translation.

PR: new exercise: pig-latin by atk · Pull Request #152 · exercism/wasm · GitHub

2 Likes