From aaf5513d9edc082e106596523c149977b7ebe389 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 22 May 2024 10:11:30 +0200 Subject: [PATCH] pig-latin: sync (#643) * Sync the `pig-latin` exercise's docs with the latest data. * Sync the `pig-latin` exercise's metadata with the latest data. --- .../practice/pig-latin/.docs/instructions.md | 18 ++++-------------- .../practice/pig-latin/.docs/introduction.md | 8 ++++++++ exercises/practice/pig-latin/.meta/config.json | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 exercises/practice/pig-latin/.docs/introduction.md diff --git a/exercises/practice/pig-latin/.docs/instructions.md b/exercises/practice/pig-latin/.docs/instructions.md index 032905aa..57170881 100644 --- a/exercises/practice/pig-latin/.docs/instructions.md +++ b/exercises/practice/pig-latin/.docs/instructions.md @@ -1,20 +1,10 @@ # Instructions -Implement a program that translates from English to Pig Latin. +Your task is to translate text from English to Pig Latin using the following rules: -Pig Latin is a made-up children's language that's intended to be confusing. -It obeys a few simple rules (below), but when it's spoken quickly it's really difficult for non-children (and non-native speakers) to understand. - -- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to the end of the word. +- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to the end of the word (e.g. "apple" -> "appleay"). Please note that "xr" and "yt" at the beginning of a word make vowel sounds (e.g. "xray" -> "xrayay", "yttria" -> "yttriaay"). -- **Rule 2**: If a word begins with a consonant sound, move it to the end of the word and then add an "ay" sound to the end of the word. +- **Rule 2**: If a word begins with a consonant sound, move it to the end of the word and then add an "ay" sound to the end of the word (e.g. "pig" -> "igpay"). Consonant sounds can be made up of multiple consonants, such as the "ch" in "chair" or "st" in "stand" (e.g. "chair" -> "airchay"). -- **Rule 3**: If a word starts with a consonant sound followed by "qu", move it to the end of the word, and then add an "ay" sound to the end of the word (e.g. "square" -> "aresquay"). +- **Rule 3**: If a word starts with a consonant sound followed by "qu", move them to the end of the word, and then add an "ay" sound to the end of the word (e.g. "square" -> "aresquay"). - **Rule 4**: If a word contains a "y" after a consonant cluster or as the second letter in a two letter word it makes a vowel sound (e.g. "rhythm" -> "ythmrhay", "my" -> "ymay"). - -There are a few more rules for edge cases, and there are regional variants too. -Check the tests for all the details. - -Read more about [Pig Latin on Wikipedia][pig-latin]. - -[pig-latin]: https://en.wikipedia.org/wiki/Pig_latin diff --git a/exercises/practice/pig-latin/.docs/introduction.md b/exercises/practice/pig-latin/.docs/introduction.md new file mode 100644 index 00000000..04baa475 --- /dev/null +++ b/exercises/practice/pig-latin/.docs/introduction.md @@ -0,0 +1,8 @@ +# Introduction + +Your parents have challenged you and your sibling to a game of two-on-two basketball. +Confident they'll win, they let you score the first couple of points, but then start taking over the game. +Needing a little boost, you start speaking in [Pig Latin][pig-latin], which is a made-up children's language that's difficult for non-children to understand. +This will give you the edge to prevail over your parents! + +[pig-latin]: https://en.wikipedia.org/wiki/Pig_latin diff --git a/exercises/practice/pig-latin/.meta/config.json b/exercises/practice/pig-latin/.meta/config.json index 4e12b07a..5c82166e 100644 --- a/exercises/practice/pig-latin/.meta/config.json +++ b/exercises/practice/pig-latin/.meta/config.json @@ -25,7 +25,7 @@ ".meta/src/reference/kotlin/PigLatin.kt" ] }, - "blurb": "Implement a program that translates from English to Pig Latin", + "blurb": "Implement a program that translates from English to Pig Latin.", "source": "The Pig Latin exercise at Test First Teaching by Ultrasaurus", "source_url": "https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/" }