6 kyu
Gambling Game Joker
234hibrahimag1
Loading description...
Fundamentals
Strings
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.
It takes a while to get it right.
#11b2y/3q4:0z:vV
these sixes are tiphareth
Kotlin translation ready for review and approval.
COBOL translation + block language specific changed in description for a neutral presentation (see recommendations: https://docs.codewars.com/authoring/guidelines/description ).
Accepted :)
Thank you :)
Given the solo note:
it may be helpful to further clarify:
joker numbers
may also have leading zerosDone.
Reference solution is incorrect. For cases where the
joker number
has any leading zeros and aserial number
has leading zeros to match, these digits are not counted.I fixed it and added another basic test case with
joker number
that has leading 0's. Please checkDone.
Input is subject to user modification.
Could you please elaborate further?
You pass a container to the user which can be altered. It's the same container that you're using for testing, so if the user modifies the contents to their will, they can pass the tests without doing the kata. So, you should either calculate the
expected
result first, or you can pass a new copy of the container to the user so it dosn't matter if they change that one.I think I fixed it now, could you please check?
This comment has been hidden.
I hope I finally fixed it, could you check please?
The tests seem diverse enough now, but this exposes a different problem. See new
issue
above.for the example
joker_card([12, 35, 1, 2, 23, 39], ['151239', '251229', '251339'])
why does the third item(251339
) return V type? the winning card is251239
and the scratch looks like251X39
. shouldn't this be losing card, since it doesn't follow any of the other categories? wierdly enough, for251229
the scratch looks like2512X9
and the answer is losing cardI believe you have to verify from right to left, and bail out when no longer matching. Edit: I can confirm it's a right to left verification process.
as @dfhwze stated, it is a right to left verification process. You check the number of last digits that are matching.