Ad
  • Custom User Avatar

    Same problem

  • Custom User Avatar

    for what this shit?
    functions dont write for this

  • Custom User Avatar

    The final result has no spaces, so no, it's not longer than 140 chars. Not a kata issue.

    If the final result is longer than 140 chars it must return false

    The final result (#CodeWars) not the input should be less than 140 chars.

  • Custom User Avatar

    I think there is an issue with a basic test ("testThatSomethingShouldHappen") request. The function should reject strings longer than 140 or equal chars.
    This request wishes to see the string "#CodeWars" but the input string is larger than 140 chars:

    $this->assertSame('#CodeWars', generateHashtag('Code' . str_repeat(' ', 140) . 'wars'));

    I'm using PHP on this Kata

  • Custom User Avatar

    Ah. Makes sense.

  • Custom User Avatar

    It must start with a hashtag (#).

    With the hashtag, it has 141 chars. Not a kata issue.

  • Custom User Avatar

    The question says "If the final result is longer than 140 chars it must return false". But, the "Too long" part (below is JavaScript version of the test code),

    assert.strictEqual(generateHashtag("a".repeat(140)), false, "Too long")
    

    just gives me 140 "a"s and does not return "false". I think that the question should be "140 chars or longer".

  • Default User Avatar

    Hi. I've been running into the same error with the Looo...ong Cat test and another one where the final hashtag is longer than 140 characters. According to the tests I should be returning False instead of whatever it is I'm returning. However I've been debugging my code in pycharm to see what was going on and what I was returning... my code IS returning False for those cases yet here it is not? I'm not sure what's going on.

    EDIT: Nevermind I'm dumb. I don't really use twitter (ig it's X now) so I thought the length of the hashtag was counted after the "#" so I was substracting 1 to the length of the final string.

  • Custom User Avatar

    arreglen el copilador, en local me funciona

  • Custom User Avatar

    My favourite kata ever! Thank you very mutch! Lllove it!

  • Custom 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

  • Custom User Avatar

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

  • Custom User Avatar

    @Anjali Singh why did you copy the tests code? Please use the initial code:

    def number_to_string(num):
        # Return a string of the number here!
    

    Probably you forfeited the kata. Not the same problem as the OP one.

  • Custom User Avatar

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

  • Loading more items...