Ad
  • Default User Avatar

    That's an unconventional way to write a 2-digit year, so I would expect that case to be explicitly called out in the description if that were the intent. I mean, for that matter, the description didn't explictly state that the digits are always in base-10, but you don't find my solution problematic because it doesn't handle input such as "A8F4", do you?

    At any rate, I will defer to the test suite, which is the ultimate arbiter for questions such as these.

  • Default User Avatar

    It could be interpreted that way, but with "0055" it is possible

  • Default User Avatar

    Year = 55 is not part of the input domain. See the kata description.

  • Default User Avatar

    Bad solution. Gives "1th" for year=55 instead of "1st"

  • Default User Avatar

    Very clever! I did not know you could do that in rust

  • Default User Avatar
  • Custom User Avatar

    No, it's not a tie:

    • P1: A pair with 7, 6, 4 kickers
    • P2: A pair with 7, 6, 5 kickers

    As the kicker 5 outranks 4, P1 loses.

    See: https://en.wikipedia.org/wiki/Kicker_(poker)

  • Default User Avatar

    According to the rules of Texas Hold 'em, if both player have the exact same class (except high cards), the highest of the unused cards is relevant (aka the kicker).

    c++

    Assert::That (run_test ("6S AD 7H 4S AS", "AH AC 5H 6H 7S", Result::Loss)); // "Highest pair wins"

    This should result as a Tie, as both have Ace pairs, and both have the same kicker (7)

    The unclarification of these rules is simply a burden for the solvers.

  • Default User Avatar

    In c++ the reversed of this problem is true: The kata states that low aces are not valid, but it does checks on the test

    Assert::That (run_test ("2S 3H 4H 5S AC", "AH AC 5H 6H AS", Result::Win )); // "Low-ace straight wins of three of a kind"