Ad
  • Default User Avatar

    Great job addressing the issues raised. I'll mark it as resolved.

  • Default User Avatar

    A hint: Count groups of 0s as well as groups of 1s in order to determine the time unit.

  • Default User Avatar
    • Title misspelled ("Interesting Kata") and doesn't tell people anything about the kata itself
    • No test structure
    • Very few actual tests, at least add more if not randomize
    • No description or explanation
  • Default User Avatar

    Please tell me which function fails in the test fixture. Otherwise I have to add a print statement to every function.

  • Default User Avatar

    Most of the problems have already been mentioned: unclear problem description, including unclear input and fringe cases

  • Default User Avatar

    What I like to do to troubleshoot in this case is print out the input. Try putting "print sequence" (without quotes) at the beginning of your function. If you're still unsure what the problem is, just reply back to me.

  • Default User Avatar

    If you haven't solved it yet and still want to:

    The test case you are having problems with is probably "YA".
    I'm guessing your check for vowels does not include uppercase vowels, and so your program just adds an "ay" to the end, thinking there are no vowels.

  • Default User Avatar

    At the bottom of the test cases, the error message is slightly misspelled:

    'Last line should not by aligned'

    should be

    'Last line should not be aligned'

  • Default User Avatar

    It wasn't clear whether the shift does or does not increment for non-alphabetic characters and whether the shift resets after each partition. Still an interesting kata!

  • Default User Avatar

    Your solution returns true for strings when whitespace characters are at the beginning of the string. This is because to_i ignores whitespace when converting to an integer.

    For example:

    zipvalidate("\n123456") => # should return false
    

    Also, consider using regular expressions. They are a powerful way of parsing strings. In ruby, the shorthand syntax for it is:

    test_string ~= /regular expression/
    

    see for more detail: http://www.tutorialspoint.com/ruby/ruby_regular_expressions.htm

  • Default User Avatar

    There already exists published kata with a similar premise in multiple languages, including python.

  • Default User Avatar

    Also, translated into Java.

  • Default User Avatar
    • Details/instructions on the definition of a "rotated string" is not clear. Specifically, the examples do not indicate that the rotation point could be anywhere within the string or even nowhere in the string.
    • Edge cases should also be explicitly defined, especially since they are part of the test cases (e.g., null strings return what).
    • Related to above: how should uppercase and lower case characters be handled? white space?
    • The details/instructions say True if one string is a rotation of another. This means s2 could be a rotation of s1, and ALSO s1 could be a rotation of s2! Either more test cases should be added, or the instructions should be changed so that the order of the function's arguments are explicitly defined.
    • Descriptions and error messages for test cases would be nice.
  • Default User Avatar

    There is currently a very similar kata already published under the name "Alphabetic Anagrams" at 3 kyu, for JS, Ruby, Python, Haskell, and Java.

    http://www.codewars.com/kata/53e57dada0cb0400ba000688

  • Default User Avatar
    • Details/instructions should define edge cases (e.g., cents <= 0)
    • Could add descriptions to test cases
    • Could add LARGE and/or random test cases
  • Loading more items...