Retired
Tarot Score (retired)
4 of 15oaz
Loading description...
Logic
Games
Strings
Parsing
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Ok, so there are some problems with this kata:
"{} should be {}"
and such. Maybe something should be inserted into the brackets?Maybe the second issue can be tolerated, but the first one makes the kata description misleading and contradicting with the Wikipedia data + tests, therefore, I do believe this kata should have not a misleading description (like,
you need to make pairs of counter+ordinary and ordinary+ordinary and then add the scores of the cards which don't have any pairs
or smth like that). =/I changed the description according to your first comment.
Can you be more specific about the 2nd one? I do not understand what you are referring to.
This comment has been hidden.
Something seems wrong with this Kata in Haskell. A 78 card hand should get a score of 55, but the Random tests are expecting it to have a large negative score.
Example:
-- >> tarotScore "SC15DQ0904D7D41703H3CQ0607H6051612HKH7H2SKHCHQ20D3C9CJS7D5DCS5D6C8H9S41014C7S0SQC4S2H419H001D1C3D0S3D9CKC1DJCCS821S90213C0C5S618S1D8H5H8HJ08C6DKSJ11H100C2D2" -- (-99) % 2
That's weird. I cannot reproduce this issue.
The expected score for random tests is computed with my solution as reference : https://www.codewars.com/kata/reviews/5868f6c57ba2f53c2100001e/groups/5868f6c57ba2f53c21000020
For the given example, it computes 55.
??? Shouldn't only ordinary cards be counted half when alone?
This simplification is just wrong.
From wikipedia: this is the true score (not a simplification); the pairing method simply makes it easier to manually count points when ordinary > non-ordinary. (I don't know the game.)
https://en.wikipedia.org/wiki/French_Tarot#Scoring
Maybe tests are right and description is wrong.
This comment has been hidden.
Random tests expect the wrong results:
There are not enough ordinary to match all 3 queens and jacks, so why
-49
?This comment has been hidden.
Another issue, unless you can count half a pair, I think this may be wrong... ;)
According to Wikipedia, you do count cards and not pairs. Yes, they're worth half a point.
However, diamond zero ?!?
Edit: clubs zero as well.
Edit edit: Oh wait. Tens. Never mind.
2 ordinary cards are worth 1 point, so 1 ordinary card is worth 0.5 point :-) This is also standard practice when playing with 3 or 5 players to count half-points when you get an odd number of cards. This does not happen in a standard 4 players setup.
From the kata perspective, this is a "hidden spec". I did not elaborate on this one on purpose in the description. Do you think I should mention it? Or stay as is so that the developper thinks about it during the kata solving process?
@JohanWiltink I thought about using "T" for ten instead of "0" but could not decide what's best.
T for 10 is standard. On computers anyway, if not using "10" (which is two chars of course). But you can ignore tens really, so it's not essential.
I'd mention the half points in the description. Esp. in Haskell, it's a pain in the neck they're not
Int
s, that's bad enough, doesn't have to be a surprise as well. Also, I hate hidden specs .. and the Wikipedia article mentions it, but that's not in the Description itself. Specs should be complete.Ok. I completed the specs with: If the number of cards is odd, the last ordinary card will count for ½ point. And I updated the Haskell initial setup to make it clear that the function returns a Rational.
The hidden test suite (for Python 2.7) will not run its random tests as the following functions are not defined at execution time:
isOudler(s), cardScore(s)
Thanks for spotting this one. This will teach me a lesson about copy-pasting... I think the issue is solved now.
Nice optimisation problem. :] Reading Wikipedia helped. Deserves more solutions!
I think I've played this game in school, in break periods. :]
Thanks for trying the kata!