Ad
  • Custom User Avatar

    Please specify a language. Help us help you. Closing.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    It made me realize that I have no idea on how to debug invisible string characters

    I found you can use console.dir() on your result for this case or just test your function in browser's console.

  • Default User Avatar

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

  • Default User Avatar

    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!

  • Default User Avatar
  • Default User Avatar
  • Default User Avatar

    thanks, that makes sense.

  • Custom User Avatar

    Because there's no such thing as 0.2 cent as price.

  • Default User Avatar

    in the javascript version:
    Test.assertEquals("$9.692".toCents(), null);
    Why would this one return null? I fail to understand.

  • Custom User Avatar

    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 return null instead of an array, so you can't execute join("") as a method of null. I think that's all I can say :). Good Luck

  • Default User Avatar

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

  • Loading more items...