Ad
  • Custom User Avatar

    Problem may have been modifying inputs, in which case you deserve whatever you get.

    Closing.

  • Default User Avatar
  • Custom User Avatar

    The test cases did not expect for any nil, so it was probably in the solver code the part that added them; that said, I changed the tests again according to Insti suggestion to make them even more reliable.

  • Default User Avatar

    The Ruby/Python translator will be able to assist when he comes online again.

  • Default User Avatar

    The Ruby/Python translator will be able to assist when he comes online again.

  • Default User Avatar

    I have asked Giacomo to have a look at his translations. It will be broken until he comes online again. Thanks for reporting it.

  • Custom User Avatar

    This is a defect in the tests that should be fixed.

    The simplest solution is to precompute the expected value before giving the argument list to the user for evaluation.

    expected = combisol(*args)
    Test.assert_equals(combine(*args),expected,"It should work for random inputs too")
    

    Your problem is that args.clone is not doing what you think it is doing.

  • Custom User Avatar

    Avoid changing the original arrays passed to your method as this may then affect the randomly generated tests.

    This is a defect in the tests that should be fixed.

  • Default User Avatar

    This thought and a tiny code change did indeed make my solution pass the tests. I sadly fail to see the reason :(.

    Thanks for your input though. Oh and great kata btw :)

  • Default User Avatar

    You may find your problem answered in the other issues posted here.

    Avoid changing the original arrays passed to your method as this may then affect the randomly generated tests.

  • Default User Avatar

    I get this in python too:

    Testing for [[{'d': 8}, 1, 1, {'d': 8}, {'w': 4}, 4, 'r', {'s': 3}], ['s', 1, 1], ['a', 'a', 1], [{'o': 1}, 1, 'r', 1, 's']]

    It should work for random inputs too: [{'d': 8}, 's', 'a', {'o': 1}, 1, 1, 'a', 1, 1, 1, 1, 'r', {'d': 8}, 1, {'w': 4}, 's', 4, 'r', {'s': 3}] should equal []

    Edit: removed redundant list

  • Custom User Avatar

    Seems to be fixed now.
    Thanks.

  • Custom User Avatar

    Ruby random tests are broken.
    The expected value is always []

  • Default User Avatar

    You're right, I did modify the array and so I modified my solution to not do so. I'll be more careful, thank you.

  • Default User Avatar

    Hi!

    Loving this kata in Ruby. I think I've found a solution but maybe also a problem with testing. On-submission tests are expecting nils when we've merged arrays with different sizes:

    Testing for:

    [{"c"=>5}, "c", "c", "s", "a"]

    ["w", {"s"=>5}, "a"]

    It should work for random inputs too - Expected: [{"c"=>5}, "w", "c", {"s"=>5}, "c", "a", "s", nil, "a", nil]

    This is, however, not the case for the default tests, where:

    ['a', 'b', 'c']

    [1, 2, 3, 4, 5]

    should yield: ['a', 1, 'b', 2, 'c', 3, 4, 5])

    No nils here. Please adjust the tests accoridngly as the instructions also indicate that nil should not be expected with arrays of different sizes.

    Thanks for the Ruby translation!

  • Loading more items...