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.
Please specify a language. Help us help you. Closing.
The queue part was extremely confusing. The console didn't said much really and was hard to see what was the problem. It become confusing because you didn't say how you were gonna use it. I think more guidance should be puten into this, otherwise it could be a great topic.
Quite frankly I'm not sure about this pattern. This pattern is fine if you use it with coroutines to yield until the method is finished.
I've made the StatePattern one and I found it to be really similar to this one. It's not very clear what the difference would be between the two, except than in one you use the variables and here you use the methods. Also found funny that the variables are all writen in caps. Interesting series though.
I notice how the test changed the state, cause I was wondering about it, and noticed that each time you want to switch you create an object.
Soesn't it create a hell lot of garbage collection if your constantly creating and destroying objects?
Whenever I use the "new" keyboard I wonder this. Would it be preferable if you'd create the two states in the tank class and re use them?
Check your types!
Expected value is not a string but a number. (This could be more clear in the description.)
Also, .match() returns an array. Correct application of parseFloat() to an array would involve .map(). This is why you are getting NaNs. See http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map.
I found you can use
console.dir()
on your result for this case or just test your function in browser's console.I really like codeWars. I think a more traditional kind of forum would be a useful addition. A place where people can make new threads with more categories, where you could ask questions to the community or discuss how to improve or learn something, etc. People usually learn by talking to other people with same tasks. I have often found myself missing a regular forum here...
haha... glad to see everyone got big long messy solutions in JS with 4loops and all (and not only me). As a feedback all I can say is that I got stuck with the first newline for quite some time not knowing what was wrong, is not a critique though. It looked like the answer matched mine exactly. It made me realize that I have no idea on how to debug invisible string characters... so if anyone know a built in way, please share the tip!
Cool trick! hahaha...
Thanks.
thanks, that makes sense.
Because there's no such thing as 0.2 cent as price.
in the javascript version:
Test.assertEquals("$9.692".toCents(), null);
Why would this one return null? I fail to understand.
Hi, the thing is that if the input string is empty, or if there is no match between your regexp and the input string
str.match(/YOUR REGEXP/g)
is going to returnnull
instead of an array, so you can't executejoin("")
as a method ofnull
. I think that's all I can say :). Good LuckThis comment is hidden because it contains spoiler information about the solution
Loading more items...