Skip to content
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

Closed
juleskers opened this issue Jan 24, 2017 · 4 comments
Closed

Comments

@juleskers
Copy link
Contributor

juleskers commented Jan 24, 2017

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:

  • word-prefix: ":doubleawesome"
  • word-suffix: "awesome:double".
    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:

@IanWhitney
Copy link
Contributor

In-line notation seem super awkward to me. Parsing seems fraught with problems, as you mention. I think a more robust structure is necessary.

@juleskers
Copy link
Contributor Author

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...

@Insti
Copy link
Contributor

Insti commented Jan 25, 2017

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.

@juleskers
Copy link
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants