Ad
  • Custom User Avatar

    Reference solution appears to have bug when both hands have one or two pairs. I debugged my own solution quite exhaustively, and could not find mistakes.

    I could submit after some trying and getting favourable random tests, and I could not figure out exactly what the reference solution is doing wrong ( or at all ).

    So I might be wrong, but I doubt it. Marking as Issue because it probably is.

  • Custom User Avatar

    Initial code is self-contradictory:

    -- | Write function 
    --   betterHand :: Hand -> Hand -> Ordering
    betterHand :: Hand -> Hand -> Hand
    betterHand = error "Write me"
    

    The comment is incorrect.

  • Custom User Avatar

    duplicate

    (if your language isn't available with this one, you should rather do it's translation than create a new one)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Random test says

    Falsifiable (after 5 tests): 
    QD AD 10H 8S 8S KC 
    JC 5H 8C AD 2C 5C 7C
    

    Wiki says "In games where more than five cards are available to each player, the best five-card combination of those cards must be played", so my solution selects second hand as having a flush of JC 8C 2C 5C 7C.

  • Custom User Avatar

    This looks interesting, but I'm struggling to understand the Poker rules.

    The Wikipedia link shows 5-card hands and explains their ranking. But the tests seem to also test for 7-card hands. How do all those concepts translate? Is there a 3 pair, for example?

    Also, the second big hand should probably read "8C 6C 5C JC 7C 9C 10C" (instead of "8C 4..") so that it is actually a straight.