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

Possible typo in ETL test #27

Closed
DouglasBrunner opened this issue Sep 22, 2014 · 9 comments
Closed

Possible typo in ETL test #27

DouglasBrunner opened this issue Sep 22, 2014 · 9 comments

Comments

@DouglasBrunner
Copy link

I'm currently working on ETL and have a question about one of the tests.

The test transform multiple keys from one value is expected to have two results, one a and one e, both of which are valued at 1. This shows that the values are not cumulative, otherwise e would be 2.

  , testCase "transform multiple keys from one value" $
    M.fromList [("a", 1), ("e", 1)] @=? transform (M.fromList [(1, ["A", "E"])])

In the test case transform multiple keys from multiple values it seems as if the result for b is treated cumulatively. In every other spot (in this track and others) b always has a value of 3, not 4.

  , testCase "transform multiple keys from multiple values" $
    M.fromList [("a", 1), ("b", 4)] @=?
    transform (M.fromList [(1, ["A"]), (4, ["B"])])

It wasn't explained in the instructions that we should be summing the scores so I'm wondering if this is a typo.

@etrepum
Copy link
Contributor

etrepum commented Sep 22, 2014

Look more closely at the input lists. There's no typo, and no sum. The values of the output list correspond to the keys of the input list.

@etrepum etrepum closed this as completed Sep 22, 2014
@DouglasBrunner
Copy link
Author

I see the problem now. I was under the impression that the scores were static, not dynamic.

It might be good to mention this point in the README since this is a large deviation from how Scrabble is actually played (offline anyways).

Thanks for the clarification.

@kytrinyx
Copy link
Member

Doug, when you mean that the scores are dynamic in the test suite, can you be more specific? In my reading of the exercise, the scores are static.

@DouglasBrunner
Copy link
Author

By static, my meaning is that a B will always have a score of 3, no matter the context (a rule-set for a round of the game for example). By dynamic I mean that in one context the B might have a score of 3 while in another context it might have a score of 4.

On line 25 of the test suite B has a value of 4 while on line 33 it has a value of 3.

So from the assumption that the scores assigned to each letter are static (my assumption after having read the README and only having played the game offline) this seems like a typo because it's unknown that B (or any other letter) can have a variety of scores assigned to it. This is where the confusion stemmed from.

@etrepum
Copy link
Contributor

etrepum commented Sep 23, 2014

Having the test provide different inputs makes it harder to implement this the wrong way. You're not supposed to hard-code anything at all about scores for this exercise, only transform one representation to another.

Scores don't change during the play of a given game, but there are different variations of the game that use different tables for scoring. Even in official Scrabble, each language has a different table for scores and a different tile distribution, due to different letter distributions in common words from that language.

@kytrinyx
Copy link
Member

Yeah, scrabble scores in Norway where I grew up are quite different. (K is a common letter, for example, and gets a much lower score than in English speaking countries). Perhaps it would be worth explicitly using different scoring tables from different countries in order to ensure that the test input doesn't let you hard-code things, while still not confusing people about scoring.

@DouglasBrunner
Copy link
Author

After reading the explanations I think that the reasoning as to why B has been assigned multiple values is really sound. Just a quick heads up in the README would probably be enough to prevent confusion (at least in my case).

@etrepum
Copy link
Contributor

etrepum commented Sep 24, 2014

Perhaps you could submit a PR to change the wording in the README in a way
that would've helped you?

On Tuesday, September 23, 2014, DougBrunner notifications@github.com
wrote:

After reading the explanations I think that the reasoning as to why B
has been assigned multiple values is really sound. Just a quick heads up in
the README would probably be enough to prevent confusion (at least in my
case).


Reply to this email directly or view it on GitHub
#27 (comment).

@DouglasBrunner
Copy link
Author

I'd be happy to. It's done.

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