Ad
  • Custom User Avatar

    The function name is misspelled in JS (should be contourMode).

  • Custom User Avatar

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

  • Custom User Avatar

    Interesting Kata. I've discovered a quirk about the javacript Array.prototype.sort method, that sometimes re-arranges array items in an unexpected fashion. For example, when implementing the following code, the expected result is returned.

    ['abc', 'def', 'ghi'].sort((a, b) => a.length - b.length).join('') // => 'abcdefghi'
    

    However, the longer random examples in this Kata appeared to break this pattern, and equivalent length strings were rearranged in the array after the sort method. I'm not able to explain this behaviour.

  • Custom User Avatar

    Oh, you're right! I called slice() on the passed array and the random tests now work fine.

  • Custom User Avatar

    Not sure if it was my particular implementation, but I was having trouble with the random empty array tests. In the examples, [] => [] // expects the empty array; however, the random tests required [] => [undefined]. See my code for awkward work-around.

  • Custom User Avatar

    Nice Kata! Just had a little trouble understanding the instructions for the skip function; specifically, I didn't know if I should be skipping the next character in the tape or the next valid character in the tape.

  • Custom User Avatar

    Some of the generated test examples are broken. This seems to occur when a cluster of 3 digits is repeated at the very end of the test. The first cluster is caught by the test, but the second is not.

    Eg. A string containing 0 153 153 0 407 407 would sometimes expect 0 153 153 0 407 713, but should in fact be 0 153 153 0 407 407 1120.

  • Custom User Avatar

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

  • Custom User Avatar

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