Ad
  • Custom User Avatar

    Hint: Number.MAX_SAFE_INTEGER doesn't seem to be working inside the framework

    No, but this is because it's an ES6 feature, and hence doesn't exist in Node 0.11. Since nobody should be using that old version of Node on CW anymore this is obsolete.

    It's misleading and it should be removed.

  • Custom User Avatar

    As mentioned below, a duplicate.

  • Custom User Avatar

    You probably don't pass the arguments to the inner function

  • Custom User Avatar

    I'm getting the same error and I'm console logging the input and I'm not getting anything helpful.

  • Custom User Avatar

    Maybe the validation tests invoke the split method because they explicitly expect a string at that particular point of execution.

  • 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).

  • Custom User Avatar

    Fixed it! Thanks!

  • Default User Avatar

    Minor thing - found a typo:
    var knightEngine = compose(moveKnightRandom, moveKnightRandom, moveKnightRandom); //It will perform tree random movements
    Should probably be 'three'!

    Apart from that, really cool kata! I'm all about shoe-horning functional paradigms into my favourite languages.

  • 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?

  • Custom User Avatar

    I really suggest adding some random test cases to this one.

    That being said, I'll go back and solve it without a switch-statement. :-)

  • Custom User Avatar

    Nope you're right - we're all wasting our time to show off, thats why regexp is a dying language......

  • Loading more items...