Pig Latin: Unclear Instructions

In the “Pig Latin” exercise, the instructions describe four rules, each of which transforms a word into another if the word satisfies certain conditions. The conditions of the rules are, however, not mutally exclusive. For example, “xray” satisfies the condition for rule 1, because it starts with “xr”, while it also satisfies the condition of rule2, as it starts with a consonant. The instructions should describe which rule should apply when a word satisfies the conditions of multiple rules. When I apply rule 4, rule 3, rule 1, and rule2 in this order, I could pass all the provided tests. But I see no reason why this should be the right order of application of the rules.

TL;DR: When the test say, “this is the order of the rules”, then that’s what your solution shall do.

Exercism in general follows the test-first principle. That means, the tests are the most precise specification of the problem. So sometimes there is some “more precise”, “new” or “unexpected” requirement in the tests. Nevertheless, tests also may not cover all possible edge cases or catch all kinds of “wrong implementation”.

In addition, any textual description in a natural language will be misunderstood by or unprecise to someone. So we tend to keep instructions short and readable instead of “complete” or “precise”. We do not want to have differences between instructions and tests, like contradicting rules - if you find that, please report it here.

1 Like