-
-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pig-latin: clarify instructions #2447
Conversation
- vowels: the letters `a`, `e`, `i`, `o`, and `u` | ||
- consonants: the other 21 letters of the English alphabet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this little bit to help non-native English speakers with the terminology.
exercises/pig-latin/instructions.md
Outdated
- `"pig"` -> `"igp"` -> `"igpay"` (starts with single consonant) | ||
- `"chair"` -> `"airch"` -> `"airchay"` (starts with multiple consonants) | ||
- `"thrush"` -> -> `"ushthr"` `"ushthray"` (starts with multiple consonants) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the intermediate step for extra clarity.
@@ -1,10 +1,48 @@ | |||
# Instructions | |||
|
|||
Your task is to translate text from English to Pig Latin using the following rules: | |||
|
|||
- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to the end of the word (e.g. "apple" -> "appleay"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gotten rid of the "sound" references, which made it confusing to me.
- **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 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 was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gotten rid of the "cluster" mention, which was confusing.
59061da
to
79337bc
Compare
79337bc
to
0c77844
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good.
The new instructions are inconsistent with the old ones. The old instructions had the same rule apply to both |
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
Do you mean the old rules treated the
I think this is why we got into the "sounds" mess in the first place: the technical definition of vowel vs consonant is the mouth position when making the sound. pedantic reference.
By that definition, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a really good re-write, and helps focus on specific patterns and actions in code, rather than the convolutions of English. 😄
No, I did not mean that, and the old rules didn't necessarily do that. Old rules excerpt:
The new rules declare Note that the above observation is independent of whatever 'vowel' and 'consonant' are supposed to mean in any context other than this exercise. You could swap out the terms for 'X' and 'Y' or whatever and it would still work. The opinions of linguists are largely irrelevant. |
....
Hence the problem with defining things by "sound", necessitating the re-write. Much better to clarify based on category. |
Preparing for this exercise's #48in24 video, I've found that many people misread the instructions and hard-coded the mentioned examples. This is in large part due to the instructions being quite unclear.