Retired

Tarot Score (retired)

4 of 15oaz
Description
Loading description...
Logic
Games
Strings
Parsing
Fundamentals
  • Please sign in or sign up to leave a comment.
  • 4500zenja1 Avatar

    Ok, so there are some problems with this kata:

    1. In the description you say that only "last cards" are counted if the amount of cards is odd — BUT how about the cases where there are more counters than ordinaries? Also, EACH card which don't have a pair should be counted, not LAST one.
    2. In Python tests, there are strings like "{} 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). =/

  • ryantm Avatar

    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

  • Voile Avatar
    SJ
    
    Expected: -54.5, instead got: -56
    

    ??? Shouldn't only ordinary cards be counted half when alone?

  • Voile Avatar

    Random tests expect the wrong results:

    SJDJD9DQ
    
    Expected: -49, instead got: -52
    

    There are not enough ordinary to match all 3 queens and jacks, so why -49?

  • ChristianECooper Avatar

    Another issue, unless you can count half a pair, I think this may be wrong... ;)

    {} should be {} for DCCQ15C01704S1CJD102D4H6C9H2H3C8HQSQD0: -35 should equal -34.5
    
    • JohanWiltink Avatar

      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.

    • oaz Avatar

      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?

    • oaz Avatar

      @JohanWiltink I thought about using "T" for ten instead of "0" but could not decide what's best.

    • JohanWiltink Avatar

      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 Ints, 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.

    • oaz Avatar

      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.

      Issue marked resolved by oaz 8 years ago
  • ChristianECooper Avatar

    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)

    • oaz Avatar

      Thanks for spotting this one. This will teach me a lesson about copy-pasting... I think the issue is solved now.

      Issue marked resolved by oaz 8 years ago
  • JohanWiltink Avatar

    Nice optimisation problem. :] Reading Wikipedia helped. Deserves more solutions!

    I think I've played this game in school, in break periods. :]