Ad
  • Default User Avatar

    Thanks for the help. I will annotate it for future katas.

  • Custom User Avatar

    In my test fixture I added a function on the Array prototype to shuffle the elements in an array. The for(..in..) loop you're using is trying to add that function to your solution variable, causing it to be NaN. I can't modify the test fixture anymore, so you'll have to modify your code. Switching the for(..in..) to a for(var i=0; i<aux.length; i++){..} should do the trick

  • Custom User Avatar

    Can you post a code snippet and mark it as a spoiler?

  • Default User Avatar

    When I clicked in "Save & Attempt" i got the following output:
    Test Failed: Expected: abcdefhijklmoprtvwxy, instead got: abcdefhijklmoprtvwxyfunction (){ var copy = [].concat(this); var ran1, ran2, tmp; for(var i=0; i

    And that is not in my code.

  • Custom User Avatar

    haha yes, that could be a constraint

  • Default User Avatar

    Sure, and one such constraint is to make a solution in as few bytes as possible :-)

  • Custom User Avatar

    Of course, I agree with you that it's all your choice. I just wanted to say that I don't enjoy solving this kata in less than 1 minute without learning anything at all (luckily a method from the string api) and to create your own constraints is a way to make it more interesting.

  • Default User Avatar

    I find it very hard not to use features of the particular programming language. Clearly, that is the whole point of having different programming languages. Take JavaScript you can 'exploit' the default functions/methods - or you can build your solution using lambda calculus only (disregarding the language features of functions being first class citizens). It's all your choice. However, translating the top-most solution into native C using no libraries shouldn't be too hard as the procedure to solve the kata will most likely go in the same direction.

  • Custom User Avatar

    I just don't understand why most of solutions are based on language specific properties. I understand katas as a way to improve the programming knowledge, this kata is awesome to practice any the famous sorting algorithms.