Ad
  • Custom User Avatar

    This is by far the most elegant solution. A+ for the loop comprehension.

  • Custom User Avatar

    That's an exceptional approach, and a good reminder. No need to reinvent the wheel. :)

  • Custom User Avatar

    Yeah... I probably should have stripped the leading and trailing punctuation from words like you, but it was much more satisfying to just not remove '-'s. Kinda like saying, "Up yours, t-rex!"

  • Custom User Avatar

    I see you ran afoul of the t-rex, as well.

  • Custom User Avatar

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

  • Custom User Avatar

    Because args passed to the spread is a list.

  • Default User Avatar

    you are right, in productive use this is absolutely vital

  • Custom User Avatar

    You shoudln't just pass on ever OSError, this could also be raised when you e.g. run out of inodes, so you would want to error there.

  • Custom User Avatar

    No problem, before I try to solve a kata from scratch I look for what functions are already available.

  • Default User Avatar

    Thank you for a wonderful feedback, i modified some of the description but not all of it , and also thank you for the test cases !

  • Custom User Avatar

    No worries. Completed it now, and it works just fine; good job!
    One thing you could add if you wish, is to introduce some randomness to your tests to make sure no easy cheats can pass.

    • First thing to think about is ranomising the order of your tests. This is pretty straightforward with CW; just use Test.randomize(array) to shuffle the order of an array, then loop through them (using .forEach maybe) and execute the tests. You can do this however you like.
    • Second is randomly-generating tests. Just use Math.random() to generate values and calculate the expected result, and then run a test against it.

    This is all optional of course, but makes sure there's no shortcuts people can use.

  • Custom User Avatar

    Thanks!

  • Custom User Avatar

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

  • Custom User Avatar

    I've added those lines to the initial modifiable test cases for Python. I'll go ahead and do the same for the other languages too.

  • Custom User Avatar

    I don't know how to see your kumite. It doesn't appear under the kumite tab for me (for any language selected). The tests are really old (or in the case of Python and Haskell, translated as literally as possible from the old Ruby tests) and so could probably be improved but the tests are locked now so I can't change them.

  • Loading more items...