Ad
  • Default User Avatar

    I don't understand how is this an issue. It's IPv4. It's obvious the valid range is from 0 to 255 (both inclusive).

  • Default User Avatar

    Until today, I didn't know there was a concept called Monad. This is truly the best Kata I have solved (solving - canReach) so far. Really thanks for this Kata surtich. This is bloody awesome. I got stuck at bind method for quite some time but figured out finally. Truly thoughtful Kata, I suppose.

    Though the below shouldn't work and return false even when there is a match, I still used this for canReach - surprisingly it gave me 100% test results. I am going to redo this part.

    function canReach(from, to, movements) {
    var validMoves = knightEngine(from, movements);
    if (validMoves.indexOf(to) < 0) return false;
    return true;
    }

  • Default User Avatar

    I get the message saying initial tests are passed and this:

    functionality tests
    TypeError: Cannot call method 'split' of undefined
    at complexFunction
    at cache
    at Test.describe

    Unsure about this. I don't use any split method in my solution. What am i missing?

  • Default User Avatar

    Didn't consider the negative values in my code. Now it works.

  • Default User Avatar

    Added few random test cases.

  • Default User Avatar

    ha ha.. how did you manage to find the test cases? Thanks for the suggestion, how do I do that?

    Edit: Thought adding random test cases was straightforward but how do I compare it in assertEquals?

  • Default User Avatar

    This is my first kata and didn't know there were few other katas with same function.

  • Default User Avatar

    I don't think '1.2.3.4' is an issue anymore however the test cases that fail doesn't says what's the expected output and actual output. I assume the test cases use Test.expect() rather Test.assertEquals(). Like most other katas, the test cases doesn't print useful data to debug.

  • Default User Avatar

    Agreed, this solution would fail for the testcase suggested by @galaxyAbstractor.

  • Default User Avatar

    This is not much helpful test output:

    Test Passed
    Expected 1,2,3,4,5,6,7,8 but was given

    If you could include the actual result in addition to expected result, would help to debug and fix what's missing.

  • Default User Avatar

    This is the coolest solution i have seen so far on codewars.

  • Default User Avatar

    The kata's test fixture should atleast specify what input number they are using so one could use that to debug the program. Simply outputing the below doesn't help.
    Going by this output, it seems the input number is a even number. My isPrime() code returns false for every even numbers and there is no way it can output true.
    Expected: [false,true,false], instead got: [true,true,false]