-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
scrabble-score: clarify syntax for :double/:triple scoring letter/word? #512
Comments
In-line notation seem super awkward to me. Parsing seems fraught with problems, as you mention. I think a more robust structure is necessary. |
Well, the boring way, but probably easiest on the user, is to just write letters multiple times (i.e. "awwwesome".) From a User-Experience perspective, that's probably the simplest and most explicit you could get. It doesn't provide any programming challenge though.. I also considered directly writing a single character, like "aw3esome", since my solution does that anyway for simpler iteration. But that immediately introduces ambiguity: does the "3" apply to the "w" (suffix) or to the "e" (prefix). An uppercase notation ("aw³esome") would be clearer, we're used to it being a suffix in maths, so it's clear it triples the "w". It's horrible to enter on any keyboard though... |
The main problem that should be well described and covered by the canonical-data tests is just the word scoring. The discussion about how to implement the extensions is part of the extended work and should not be specified in the problem description. |
That sounds very sensible! I'll stop any work in that direction then (other than my own exercising) |
Update README to use Ruby version 2.1
While trying my hand at the scrabble-score exercise, I wasn't clear how to interpret the optional extensions.
The spec doesn't clarify what the input would look like for that extension.
For the double-scoring letter, it seems obvious to me that an input would like "aw:doubleesome" would double the "w", but arguably, it could also mean that the "e" should count twice (if I interpret the colon ":" to mean: "warning, escape sequence starting, sequence includes the multiplyer and the character it applies to".
For a double-scoring word, it is even harder, would it be:
Both have the problem that their parsing is ambiguous, depending on how double letters are parsed.
If "word:double" is given, it is unclear if that is a double-word in suffix-notation, or double-"d" in suffix-notation. If letters follow suffix-notation (i.e. "aw:doublee" doubles the "w"), the only unambiguous syntax for double-word would be ":doubleWord", and vice-versa.
I'd suggest adding an example or two, for both letters and words.
Is this desirable, or is it intentionally left vague, to allow maximum flexibility on the exerciser who is bold enough to try the optional work?
related:
The text was updated successfully, but these errors were encountered: