Ad
  • Default User Avatar

    Hey @sperry, thanks for clarifying that - just updated the example and it should be more clear now.

  • Default User Avatar

    Hey @iamchingel, thanks for your translation! Looks okay, approved.

  • Default User Avatar

    Hey @zebulan,

    I updated your revision. Turns out, as @AcesOfGlory pointed out, expected / actual arguments in tests were in reversed order, I changed:

    Test.assert_equals(solution(cards), sort_cards(cards))
    

    to:

    Test.assert_equals(sort_cards(cards), solution(cards))
    

    in all tests.

  • Default User Avatar

    Hey @AcesOfGlory,

    "you have the actual and expected solution the wrong way around for all your test cases"
    Oh wow, I've just noticed that. @zebulan edited my kata, but I assumed it was correct and actually just got a notification that it happened, I didn't even have to approve it. You're right though, I just noticed that the actual / expected were in the wrong order. Thanks for pointing that out! I reversed the order and now it's correct.

    @snormandeau, I tried to submit your code and unfortunately it fails. After updating kata with correct actual / expected order if you add a test: Test.assert_equals(sort_cards(list('T824Q')), list('248TQ')) your code still fails, but now shows the correct error message. BTW, there's an error in your base variable, it should be: base = ['A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K'] - I removed the Ace that came after King, as it's a duplicate and kata's description clearly states:

    All cards in the list are represented as strings, so that sorted list of cards looks like this:
    
    ['A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K']
    
  • Default User Avatar

    Hey @Joz, thanks for the comment.

    What do you mean by "strange things with tuples\lists in test cases"? What's "strange"? What exactly can be more clear? Could you please elaborate a bit more on what you mean?

  • Default User Avatar

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

  • Default User Avatar

    Hey sperry, thanks for the kind words!

    I added (less than) to the description to clarify what I had in mind. It was intended to be "<" and I put that in my solution. I'm afraid it could be hard to check when it comes to time and Codewars, as the result may vary, and so on. :)

    I also added "Dates/Time" tag.

    Cheers!

  • Default User Avatar

    Awesome, thanks!

  • Default User Avatar

    Hey snormandeau, thanks for the comment.

    Could you point out where and how did that happen? Are you referring to Python or Java version? Yes, 'T' should come before 'Q', because Ten comes before the Queen in a deck of cards, value-wise. I just checked the solution as well as tests and I'm afraid I can't replicate this issue right now.

  • Default User Avatar

    Yup, you're right. I had some trouble uploading the updated signature, but it's fixed now. Thanks for pointing it out!

  • Default User Avatar

    Hey, thanks a ton! I've just fixed it. Thanks.

  • Default User Avatar
  • Default User Avatar

    I have updated tests so that it should accept such outputs too. Thanks for your input!