7 kyu
Hearts (Card Game) Kata 1 of 3
163p4songer
Loading description...
Games
Puzzles
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.
Maybe change the "10" to "T", so that it's one character, just like all other ranks.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Please add to the description a case/input when the card that is the only card of a certain suit is not at index
0
. The current description makes it looks like when we met cards that are the only card of a certain suit, it matches them directly regardless of position, but this is not the case in the actual tests.Thanks for the suggestion about adding more clarity to the description! I just wanted to make sure I was understanding you about what specifically you wanted changed, because it sounds like this might be a potential issue with my code, or one of the unit tests.
When an array is given, it should be assumed that the first card in the array is the
suit
for that hand. All other cards played must match thesuit
in order to be considered for winning. If there is no other card played that matches the suit in position 0, the card in position 0 will always win. If two, or three, or four cards aresuited
, then the card with higher value will win.If that is the experience you had with the actual tests, I think we're good as far as code correctness, if you got a failed test after providing a correct answer, please give me an example with the input, and the output and I'll get it fixed asap. Otherwise, I did add a new example to the description so that given the input:
['9D', '9C', 'QD', '9S']
we should expect the output:'QD'