Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Them's just the rules. Specifically, a 4-card flush is scored only when the four cards in the hand are of one suit. If the start card happens also to be of the same suit as the four cards in the hand, one would score a 5-card flush instead. Even better, when scoring the actual crib hand, only a 5-card flush is counted (that's not a factor in this kata, btw).
I'm sure these rules exist for reasons other than to confound newcomers to the game but that said it's an odd little game with a fair complement of odd little rules.
I can see that the language in the kata description could be improved to better emphasize the restrictions pertaining to the scoring of flushes. I'll edit and re-publish it shortly.
I'm actually comfortable now with 4,000 randos. I might add a set of edge/corner cases that the testing code draws from (using random.sample) periodically as it dispenses its 4,000-strong maelstrom of test cases.
I'm humbled by your solution, btw. I have been an assembler and C (IBM mainframe, so yes COBOL too) programmer for, let me see...
...let's just say a while and leave it at that. Anyway I dived into Python last year and I know that your solution would have have been impenetrable to me earlier this year and now it intriges the heck out of me so that's progress. Is Python your go to language? There's a savant quality about it (which I say as a compliment) that alludes to a comfortable familiarity with the language and its armada of libraries, and/or an inate savant ability.
Okay I'm being facetious but seriosly, nice work. I may have questions yet...
Cheers
Kevev (K3nH2l) Hall
I cut the number of tests as suggested. I was really more concerned with coverage than performance tho. Stll, Im keen to scope out your solution later today. I only started playing with Phython at the end of last summer and I'm quite impressed if not totally comfortable with its eschewance of static type-checking and its insistance that indentation is a programmatic determinant of logic flow.
Anyway, this was challenging but it had me scrambling at an enjoyable level of intensity.
Okay, typos have been fixed (note that "players' scores" is is correct because plural nouns ending with "s" become posessive by the addition of an apostrophe alone).
I agree about the pre-loaded code. It prods potential solvers unnecessarily. The less I give them, the more likely it is that they'll find a solution more elegant than mine. I moved the pre-loaded code to my complete solution (since it uses it). I'm new to Python and I was probably overly enamoured of my one-liner dictionary comprehension.
I also changed the representation of 10-cards from "X" to "T" and reflected this in the doc, testing code etc.
Primped, polished and republished.
Thanks for the quick feedback. I've addressed all the issues you raised and re-published
Another excellent challenge. I can say without reservation that, to date, your Kata are the most engaging and satisfying I've found on Code Wars. Your test cases are exemplary. Thank you, and keep them coming!