Ad
  • Custom User Avatar

    No problem, and you can (almost always) use console.log to print the input and check what it was.

  • Custom User Avatar

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

  • Custom User Avatar

    Javascript.

  • Custom User Avatar

    Ah, is that so. I didn't think that would be the case. I'll look into it. Thanks

    Just asking out of curiosity, which language did you solve the kata in?

  • Custom User Avatar

    match not always returns an array, check that.

  • Custom User Avatar

    Yes, I'm using match. And btw I checked once again. The sample tests run fine now. But the problem persists when testing for random tests with Attempt.

  • Custom User Avatar

    I've tried my solution again and it passed. You didn't say, but I guess that's in javascript. Are you using match?

  • Custom User Avatar

    I seem to be having a problem. But I'm not sure whether it's an issue with my own code or whether there's a problem with the kata. All the sample as well as the random tests were successful. However, in both the sample and random tests I get this TypeError: Can't read property '0' of null. And the thing is, with every Attempt, the number or errors keep changing. From 8 errors, to 5 errors or 6 errors or 2 errors.

    There doesn't seem to be a problem with the code though. I copied the entire thing, both the function and the input and tested them in the console. Didn't get the TypeError.

  • Custom User Avatar

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

  • Custom User Avatar

    Could be because it looks cleaner?

  • Custom User Avatar

    I have a similar solution but use slice to keep the original array as it is. It's certainly not required to pass the test cases but I think is a nice challenge.

  • Custom User Avatar

    I'm the F# and OCaml translator, so any suggestions for those could be tossed my way. :)

  • Custom User Avatar

    That's a good criticism; I was "following along" with the Javascript translation and didn't think to check how the Haskell translation worked.

    That being said, I found that having the signature as a list actually made my solution simpler. Although I suppose that's subjective ;)

  • Custom User Avatar

    Try to print() the input and figure out what it should return and how it should behave...

  • Default User Avatar

    Hello. I tried solving this kata in Python. It passed 7 basic tests and then gives a stderr saying that an 'int' object is not subsciptable. I copied the whole function and tried in Python IDLE (Python 3.4.4). I gave it all the signature inputs specified in the basic tests. It didn't give me any kind of error. What has been going wrong?