Ad
  • Custom User Avatar

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

  • Custom User Avatar

    I agree: "Ghost objects are given a random color attribute"

    The color is an "attribute" of the object. So it should not change with each call to color.

  • Custom User Avatar

    This Kata makes no sense in Ruby.

    The description states "accepts the name of a programmer", but it is supposed to work without the name of a programmer!

    The solution is to remove this test case.

  • Custom User Avatar

    I don't think this is level 8. Seems far too difficult for a novice.

  • Custom User Avatar

    Hi,

    Thanks for your feedback.

    The test cases are supposed to tell what isn't working.

    Using a regexp on the internet is a pretty bad idea, especially for Codewars. I guess I can update the description to explain why people should come up with their own solution (which may not be a regex!).

    FWIW, I came up with this kata because I was given this exact requirement at my job. Using a regex off the internet didn't make sense to me because I couldn't work with it and didn't know what it was doing. So I came up with my own test cases and wrote my own regex. It was actually quite easy. The time consuming part was learning enough about regex to do it.

    So, I wanted to give that experience with all the users of Codewars.

  • Custom User Avatar

    This line doesn't make sense to me: "#you can check for "%" operator"

    Is it supposed to mean "#you can use % operator"?

    But I don't think using the % operator is the best way to solve it anyway...

    Also, I don't think the method should modify array, unless it has a !. So perhaps this requirement should be added to the kata (and tested)...

  • Custom User Avatar

    Great kata! Here's a test case:

    Test.expect( line_types( input ) == [ :alpha, :beta, :alpha, :unknown, :unknown ])
    
  • Custom User Avatar

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

  • Custom User Avatar

    OK, I added more test cases. If you have any test cases, I would be happy to add them.

  • Custom User Avatar

    The goal is to learn a programming language. Not to implement RFC-5322.

  • Custom User Avatar

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

  • Custom User Avatar

    Very difficult to solve, but this clue helped me:

    "The description has a very important word highlighted."

  • Custom User Avatar

    Oh, now I understand what this code is supposed to do. You might want to add this to the description:

    I initialize the pagination helper with [1,2,3,4,5], with a page size of 2. The helper class should then split the array into:

    page 1: [1,2] page 2: [3,4] page 3: [5]

  • Custom User Avatar

    I would say:

    • key1, key2
    • key_level_1, key_level_2
    • path_part_1, path_part_2

    But it is not really a path at all. It is a hierarchy of nested hash keys. So perhaps key1...is best.

  • Custom User Avatar

    It seems that path1, path2, etc. are really part of the path. It might be clearer if it was named "level" or something else.