I recently encountered this challenge posted on edabit.com. It is a kind of weird translation tool that follows two patterns for translating words:
Consonant starting words: move consonants from the begging of the word to the end and add “ay”.
Vowel starting words: add “yay” at the end of the word.
- apple > appleyay
- edit > edityay
- elaborate > elaborateyay
- car > arcay
- fallout > alloutfay
- translator > anslatortray
So as it seemed a fun thing to code I created small project to solve the exercise, ending up with a .net core web app:
GitHub repo: https://github.com/mickaj/piglet
Running web app: https://piglet.mkajzer.hostingasp.pl/
Go ahead and see my implementation and test it. Or if you fancy challenge yourself!