> On Sat, 8 Jun 2002, Sean O'Rourke wrote: > > > > > # Secondly, $" & $& produces null when $& is a capital letter, so > > > # the > > > > Once again, the fact that only the first letter may be capital came to > > my rescue. > > > > Actually, there's one more bug as well here. If any of the tests had > > contained a '.' in the middle of a word (allowed by the rules, I think), > > "s/[^. ]+ */.../" would have stopped too soon. Taking the rules to be > > defined operationally by the tests rather than formally by the web-page > > saved me in quite a number of ways. > > No, the rules didn't allow a period to occur within the word, so you're safe > on that one.
>From the rules: "A word contains at least one alphanumeric character (letter or digit), and optionally some punctuation (. , ; : ' " ( ) & /). Note: This means that punctuation characters can never occur alone. But except for the period, which must end a sentence, punctuation can occur anywhere in a word." I took this to mean "punctuation, including '.', can occur within a word, but since '.' can end a sentence, only non-'.' punctuation can end a word. This seems like a more careful reading which, if universally followed, would have resulted in a lot more solutions with /\S*\w\S*/ in them. But the refs, in writing the tests, either did not test this corner case, or interpreted the rule the other way. > But I always thought the aim was to solve the problem, rather than > merely to pass the tests. After sending the last mail, I have had second thoughts about taking this approach. Certainly on a problem like Kolakoski or Cantor, defined by a few simple rules, this would be a "morally degraded" form of golf. But when the spec is over a page long, it will almost certainly be ambiguous. Sometimes a careful reading will allow shorter solutions, sometimes it will exclude them. Sometimes the "careful reader" will ask the refs for a clarification, sometimes not. Sometimes the clarification (and suitably adjusted tests) will invalidate many top solutions. I believe that a dot in the middle of the word would have put Eugene ahead of Ton. If each had legitimately interpreted the spec in a different way, and the refs had found the ambiguity in the last hour, what should have been done? A test suite is unambiguous -- you either pass it or you don't. I believe my tactics demonstrate at least that either the spec should be simple enough for its intent to be clear, or the task should be defined by the tests. /s
