Ad
  • Custom User Avatar

    (considering the actual task, I guess it's different enough)

  • Custom User Avatar

    The specs about how to redistribute the "non even" values must be given in the task section, not only in the examples.

  • Custom User Avatar
  • Custom User Avatar

    (Î'm pretty sure this is a dupllicate, btw)

  • Custom User Avatar

    isn't the last example of the description false?

    When chances are equal and can't be evenly distributed. Follow the original order of chances array
    
    Given [22, 9, 22, 22, 9, 2], 14
    
    It should return [25, 11, 25, 24, 11, 4]
                      +3  +2  +3  +2  +2  +2
                          ^^^^^^
    
  • Default User Avatar

    looks like everything is fine

  • Custom User Avatar

    Can you verify if it's ok now. Make sure to reset the kata in the editor.

  • Custom User Avatar

    That's an issue of the kata. EDIT: ok you logged an issue :) EDIT EDIT: and I fixed it ;)

  • Default User Avatar

    In random tests, the same array is used for both the user's solution and the reference solution, so the user can change the original array, for example using the map! method, which will affect the tests. It is worth using a duplicate array in tests, or write in the description that the user is prohibited from changing the source array

  • Default User Avatar

    I figured out what the problem was, I used the map! and in tests the same array is used for both the solution and the reference solution

  • Custom User Avatar

    I see, somehow the reference solution passes all tests. So maybe we are missing something. To be honest, I don't even understand the description of this kata. I passed by trial and error.

  • Default User Avatar

    Yes, I described it too vaguely) In random tests, the added values are doubled

    Must be

    [[26, 54, 3, 4, 1], 12] => [26+3, 54+3, 3+2, 4+2, 1+2]

    random tests require

    [[26, 54, 3, 4, 1], 12] => [26+6, 54+6, 3+4, 4+4, 1+4]

  • Custom User Avatar

    I don't understand what you are saying, but it does look random tests are complete BS

  • Default User Avatar

    The sample tests from the example do not coincide with the logic of random tests, or are insufficient: sample tests assume the result as probabilities totaling 100%, random tests assume probabilities totaling 100% + the dropped probability

    [[26, 54, 3, 4, 1], 12]

    expected: [32, 60, 7, 8, 5]

    got: [29, 57, 5, 6, 3]

  • Custom User Avatar

    resolving

  • Loading more items...