Ad
  • Default User Avatar

    Hi! Thanks for feedback.

    It seems that Test.assertEquals uses Test.inspect, which in turn uses stringify... which is strange, as it presumes comparison with ===.

    Changed a test fixture to use Test.expect with === when comparing objects, try re-submitting. And please check that the context is correctly passed to the handlers, because a correct solution shouldn't have this problem.

  • Default User Avatar

    In the second case you are modifying the scope var args in resulting function call

    args = args.concat(args1)
    

    , which can lead to incorrect behavior at its subsequent calls:

  • Default User Avatar

    Thank you for the feedback. Unfortunately all the emails from codewars have been sent to spam for the last few weeks, and that's why I didn't fix the issue right away.

    Added an example for the context

  • Default User Avatar

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

  • Default User Avatar

    This is a good point, and there are a lot of katas here like that, but IMHO such description doesn't explain why would you need such a function in the first place, or how it can be used in less artificial cases.

    In my experience, in real life you seldom get a clear objective, more like some vague description of a problem with more than one way to deal with it (although this kata is not the case). That's why I now try to make my kata more descriptive, especially low level

  • Default User Avatar

    Thanks for the tips, I'll try to be more careful in advance))

    Still, is it possible to block any navigation attempt (which is not a "happy path" of kata completion) with a confirmation window, or it doesn't work with history? I saw something like that in kata creation page, that's why I am asking.

  • Default User Avatar

    Argh! It happened again!

    Can you please implement an autosave or at least make the kata page prompt you before navigation if the values in the text boxes have changed? because sometimes it goes back on its history on Mac after a careless swipe. Of course when I navigate forward again all my code is lost.

    It was fine when katas were short, but if this happens after about an hour of coding...

  • Default User Avatar

    You do not test against an animal which checks a name argument but does not init this.name - probably because of a typo in the test case:

    var MissingNameInitAnimal = (function(){
        function Animal(name, age){
          if (typeof(age) != 'number'){
            throw new RangeError('age is not a number')
          }
          
          if (age < 0){
            throw new RangeError('age is less than zero')  
          }
          
          /**
           *  a-koptsov: should be: this.age = age instead
           */
          this.name = name;
        }
    
  • Default User Avatar

    The new layout is pretty cool, but the profile page seems to be a little broken:
    bug captured

    Firefox 26, OSX 10.8.5

    Why add this block to the profile and dashboard - and not to the library aka catalog (katalog?)

  • Default User Avatar

    You need to add more test cases - specifically for &amp; - and try to make them random, to exclude the possibility of brute-force solution, like

    if (str == '<p>Lorem ipsum dolor sit amet.</p>') return '&lt;p&gt;Lorem ipsum dolor sit amet.&lt;/p&gt;'
    
  • Default User Avatar

    Good job!

    You can read this link for more information about Codewars test framework

  • Default User Avatar

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

  • Default User Avatar

    Good point. I will certainly fix that, although not right now

  • Default User Avatar

    BUMP: Feedback and ranking, anyone?))

  • Default User Avatar

    The right answer for the hard-coded answers problem is: generate new dates for each test run.

    You have a working solution, it's possible to just add it to the fixture with another name and compare its results to a warrior's solution results for any random date. And since you will publish this dates to the output, a warrior will be able to see the cases where his/her solution fails - while being unable to hard-code any answers

  • Loading more items...