Ad
  • Default User Avatar

    As matt said, it is no issue.

  • Custom User Avatar

    Probably more a suggestion than an issue.

  • Default User Avatar

    I banged my head against this for a while, so I'll say to pay attention to "Each value should be in the range 0-255."

  • Default User Avatar

    I'm having a problem in the submission that apparently one of my images is not similar enough, but there doesn't seem to be any difference to the naked eye. http://imgur.com/hnBJDvM. Can anyone give me any hints as to what might be going wrong?

  • Default User Avatar

    Would prefer more spacing in the test functions and array examples; they look a little cramped. Also missing an apostrophe in the description ('Lets').

    Otherwise GREAT kata with NO problems.

  • Default User Avatar

    Hi,

    I enjoyed this kata! As with others, I agree that it would be helpful to clarify that you take the 'first bit' to be the lowest bit.

    Also, is much gained by having the movement bits go [positive, negative, negative, positive]? It highlights the importance of reading the spec carefully, but is a bit weird, so I'm split on the issue.

  • Default User Avatar

    Sorry about that. I've updated the example test to use Test.assertSimilar rather than Test.assertEquals. The submission test uses a more sophisticated algorithm to check the results, rather than just comparing your result to another object.

  • Default User Avatar

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

  • Default User Avatar

    Getting this result:

    Expected: {"Mercy":["Chen"],"City":["Anderson","Eastman"],"General":["Davis","Ford"]}, instead got: {"Mercy":["Chen"],"City":["Anderson","Eastman"],"General":["Davis","Ford"]}

    A problem with strings?

  • Custom User Avatar

    Hello,
    Your solution isn't that weird. Actually I'd say you are on a good path!
    Only one loop, no regexp, ... seems clean and efficient.

    But indeed you'll likely get a "Process was terminated. It took longer than 6000ms to complete" for now, because there are a couple of bugs.
    In order to fix this, I recommend you to add temporary console.log() to troubleshoot how far you go in the parsing.

    Also take the time to re-read all your code.

    Let me help you with the following tip: in newWords and newLines functions, you are using String.prototoype.indexOf to look for a specific char, and then do some things according to it.
    That's good. Also, you are using the facultative second parameter to specify a starting index, which is really a good idea to have a fast implementation: you jump from word to word (or line to line), rather than char by char.
    However, the second time you are using the indexOf, you forgot the second parameter! Therefore the second search starts from the beginning of the string.
    Thus, you might end up in an infinite loop. Indeed, indexOf might return a value smaller than the current index, leading to infinite loop.
    Exemple:

    chunk.text = "Once upon a time"
    
    # first loop
    .indexOf(" ", 0) = 4
    .indexOf(" ") = 4
    i = 4 + 1 = 5
    
    # second loop
    .indexOf(" ", 5) = 9
    .indexOf(" ") = 4
    i = 4 + 1 = 5
    

    It would be weise to store the indexOf result in a variable and re-use it rather than searching again a second time in the string.

    Also it seems you forgot to call this.reader.getChunk(); in the loop ;)

    Let we know if you're still having trouble.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Get the following error when I run the tests: "Expected: 10 9 8 7 6 5 4 3 2 1 liftoff!, instead got: 10 9 8 7 6 5 4 3 2 1 liftoff!"

    Not sure what could be going on ...