Ad
  • Custom User Avatar

    This isnt the point here, the clever votes was just because it's really a funny way to not resolve the problem but pass all tests. you're just so serious to understand.

  • Custom User Avatar
  • Custom User Avatar

    The kata was made with a standard Connect Four setup in mind, and nobody's going to change the requirements now.

  • Custom User Avatar

    The top "clever" solutions aren't dynamic. Curious how many would fail if the array width/height was 1000x1000 🤔

  • Custom User Avatar

    To beginners thinking this is a "clever solution" that they can't wrap their minds around... It's basically an array of all the expected test return values. Does nothing to help teach what an actual clever solution looks like, but instead shows what a person can do with too much time on their hands for a level 6 kata, to appear "clever" to people who wouldn't know the difference.

  • Custom User Avatar

    Pretty nice "real world" kata.

  • Custom User Avatar

    There is a carriage return after some chars, so we have 2 lines.
    The empty string is indeed considered as 0 line. I can feel your confusion.
    I can see your logic but it wouldn't make sense to dismiss empty lines. Imagine a text with empty lines in the middle, it would be weird to skip them!
    I see it as a very specific case: empty string = absolutely nothing. Not even a single char to consume. It would be weird to use a text parser for an empty block of text.
    The way i see it:

    • Empty string = 0 line
    • At least one char = a line
    • Increase line count for each carriage return seen

    I suppose the kata wasn't overrly specific about that, but I'm sure you managed to fix it with the test cases.

    It reminds me of something somewhat related:
    If you look for "" (empty string) in a string [see .indexOf() implementations], at which position do you find it?
    At the beginning, the end, between each charcater, none?

    Cheers

  • Custom User Avatar

    Why do you consider the second blank line in this to have 2 lines?

    "Once upon a time.
    "

    ...yet the empty string represents 0 lines?

  • Custom User Avatar

    I don't see how people have the default var helloWorld = function(){...}
    It was failing for me just because of that.

    I feel like if you should change the boilerplate if it's going to prevent a "pass"