Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
As mentioned below, a duplicate.
You probably don't pass the arguments to the inner function
I'm getting the same error and I'm console logging the input and I'm not getting anything helpful.
Maybe the validation tests invoke the
split
method because they explicitly expect a string at that particular point of execution.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).
Fixed it! Thanks!
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.
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;
}
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?
Didn't consider the negative values in my code. Now it works.
Added few random test cases.
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?
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. :-)Nope you're right - we're all wasting our time to show off, thats why regexp is a dying language......
Loading more items...