Ad
  • Custom User Avatar

    Thanks for contributing a translation to this Kata. I think your proposed solution is still missing some code. Notice how some closing parenthesis are missing in the proposed solution.

  • Custom User Avatar

    It was unfortunate that when I defined the Kata I did not foresee that people would use those methods to avoid doing the actual recursive/functional implementastion of the solution. Later I wanted to make that feature unavailable to force the right thinking patterns, but that would most likely break all other solutions already offered. So, to avoid that I kept it as is. Some people will solve it the right way and others reading the answer could compare the solutions.

  • Custom User Avatar

    Nothing has changed in this Kata since the beginning so I'd be surprised that it starts failing now. I have double-checked the batery of tests and they all pass and they all make use of Cons which is defined in the preload section of the Kata. So, there must be something in your code or something failed in Code Wars. I just tried doing the solution again by training on my own Kata and it all worked fine.

  • Custom User Avatar

    I think the main problem I have seen with most solutions is the deceiving idea that all characters are 1-byte long, whereas JavaScript characters are multibyte. It is unfortunate that the tests for this Kata did not take that into account, otherwise many of us would have to go back to the drawing table.

  • Custom User Avatar

    The following did not pass my tests (at least not with nodejs v.0.10.22)

    expect(''.toBase64()).to.be(''); //TypeError: Cannot call method 'map' of null
    
    expect('Zm9vYg=='.fromBase64()).to.be('foob'); //Error: expected 'foob\u0000' to equal 'foob'
    expect('Zg=='.fromBase64()).to.be('f'); //Error: expected 'f\u0000' to equal 'f'
    expect(''.fromBase64()).to.be(''); //TypeError: Cannot call method 'map' of null
    
  • Custom User Avatar

    This was fun, although pretty laborious to complete!

  • Custom User Avatar

    This is pretty interesting. You managed to do recursion using an extra argument not declared originally in the function signature. I guess I am too accustomed to statically-typed languages to have ever thought of something like this . That was smart! I will now add it to my toolbox ;-)

  • Custom User Avatar

    Wow! That's pretty slick!

  • Custom User Avatar

    Thanks for your feedback. I have addressed all your comments to my best understanding of your requirements. I hope that makes this Kata better.

  • Custom User Avatar

    Wow, the last test really gave me a hard time. It took me a while to find my own bug. No wonder they call it a "turing tarpit".

  • Custom User Avatar

    This Kata was real fun! I was not familiar with Befunge and it was certainly very interesting to program. It was actually simpler than it originally looked. As other have stated, the hard part is to debug the code.

  • Custom User Avatar

    I will decommission it right away!

  • Custom User Avatar

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

  • Custom User Avatar

    I think there should be a mechanism to encourage users to move Katas down pipeline until the reach a final status (regardless of the position of the Kata). Similar to Stackoverflow revision features. Users that have reached certain amount of reputation can participate in reviews, and get more reputation out of them in the form of badges. In the review process you are randomly presented with questions or answers that need attention. The user then gives an opinion on the case and move on to the next case.

  • Custom User Avatar

    Wow, I literally spent like an hour investigating why this does not work in JavaScript

    new Array(10).map(function(u){ return 1;});
    

    And now I see you answer and I think this Kata is worthy only for having learned this lesson. That is pretty slick. I rewrote my answer using the trick.

  • Loading more items...