Ad
  • Custom User Avatar

    Hmmm, I see what you are getting at.

    I've updated the kata description to include the case with the empty entries. It's not great but I'll try and update the description later today to be more clear about what is expected for this particular problem :)

  • Custom User Avatar

    I've updated the Kata test to warn about the possibility of having consecutive commas. I see how that could be unexpected.

  • Custom User Avatar

    Of course not. You have to decide when to stop. Or read the edge cases covered by the tests and only worry about those.

    Why would you think that the string would contain non-numbers? or isn't a string, or anything else that isn't in the description? If the input isn't what you expect, thrown an exception or an error. Simple as that.

    If I wrote about all possible edge cases, I would be here all they and no one would have to think about them.

    The unit tests cover what I think is relevant for this kata and nothing more. The ones I don't show in the example are handled by the rest of the test cases, anything else doesn't matter (for this Kata obviously. If this was a real systems, I'm sure other things would need to be considered.)

    As for the commas, I'm not enterely sure what you mean but that case is contemplated in the test cases. Infact that was one of the reasons that made me write this kata (this was actually a problem I had to solve in my day job)

  • Custom User Avatar

    Yes they do, but that is on purpose.
    Programmers must always consider corner cases. This is my atempt to get people to think like that :)
    I could put that in the description but I chose to ommit it. If the person doesn't consider them, then the test will catch it and the person will learn.

    IMO, if you solve everything on the first try you don't learn much, and if you do, then you already know it anyway and that's the point :)

  • Custom User Avatar

    Can you elaborate?

    The test cases cover all that :) And there are 100 more random tests that are automatically generated.

    Also, this is python, so you don't need special handling for integer types so your solution can handle both cases whithout problems.

    Anyway, this was my first kata so I apreciate the feedback. I'll update the description to include negative numbers.

  • Custom User Avatar

    Take a look at AcesOfGlory reply ;)

    split(",") will return empty strings and trying to call int(s) where "s" is an empty string will throw that exception.

    You can easily verify this on the python interpreter or a python script with this code: int("")

  • Custom User Avatar

    Ruby and Crystal are done however I don't see a translation to the javascript code :S

    Could you submit again?

  • Custom User Avatar

    Could you merge the difference between your translations?

    Codewars dosen´t allow me to aprove your translation until
    you merge the changes you made to the description :S

    (i get the following error: "Description cannot be approved, recent changes from related record must be merged first.")

  • Custom User Avatar

    Looks good to me!

    How can i accept your translation? (sorry i'm new to all this and can´t find a way to do that :S)

  • Custom User Avatar

    Fixed :)

    Thank you.