Ad
  • Default User Avatar

    Got it, thanks

  • Default User Avatar

    In the input string you have "2" and "200" not "2" and "2"

  • Default User Avatar

    Have question for the last test case:

    '1 2 2 4 4 6 6 7 7 18 27 72 81 9 91 425 31064 7920 67407 96488 34608557 71899703'
    should equal
    '1 2 200 4 4 6 6 7 7 18 27 72 81 9 91 425 31064 7920 67407 96488 34608557 71899703'

    Can anyone explain why the second 2 should be 200? Thanks

  • Custom User Avatar

    Trying to understand the rules for sorting two numbers with the same weight was really confusing because of the wording. I think this is an improvement:

    When two numbers have the same "weight," sort them as strings and not numbers. For example, "180" and "90" both have the same weight (9), but when compared as strings "180" is first.

  • Default User Avatar

    I updated the python version: it now handles 20000 random tests too.

  • Default User Avatar

    Hi booleangate,

    Randomized tests are common practice on codewars on a submit. Just to prevent people from cheating. And I can assure you that there were people who did when I did not have them ;)

    The way I do it, I do not any the problem. What I do find a problem is when people generate random input and use there own initial solution for generating 'expected' output. In that way all the bugs, undocumented functionality etc. of the initial solution are from then on 'by design'.

    In my daily work I never used randomized tests and I even never use tests with DateTime.Now but only with fixed dates.

  • Default User Avatar

    Hi,

    I had troubles to validate/publish the python translation with 20000 tests (slowes down the navigator "to death"...). That's why I reduced their number. I just modified it to 10000. Seems to work.

    @FrankK: btw, you never replied to my questions in the sortable poker hand kata. Could you please take a look?

    EDIT: Actually... if the validation work in the edit panel with 10000 random tests, impossible to publish it: server times out each time. Tried with 10000, 5000... No way. Passed with 2000.

  • Custom User Avatar

    The issue isn't the number of tests, it's that they are random. You should do the same tests with the same input every time.

  • Custom User Avatar

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

  • Default User Avatar

    I agree. That is why I originally did 20000 random tests with the same range of hands. In that case, there is no chance that hands are NOT tested against each other.

    The translator for Python lowered it to 1000 random tests for Python. I don't know why. It still sounds like enough tests to be not 'non deterministic'.

  • Custom User Avatar

    Non deterministic unit test are Bad(TM). Depending on the solution, the randomized tests may pass or fail from run to run. They should be changed to a cross product (testing all hands against all other hands).