Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    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

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Thanks for the quick feedback. I've addressed all the issues you raised and re-published

  • Custom User Avatar

    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!