Ad
  • Custom User Avatar

    Hi Steffen,
    No, I still have it at "very" satisfied because I did learn a lot from this kata and I appreciate that.

    And also... I think you are right! The error message is wunderbar. It was my interpretation of it which was wrong. I see indeed, now, that when I run the "count_visible.." func with an empty string "", then it returns "1" instead of "-1" like it should. I'm new to codewars, and didn't know that "1 should equal -1" means that my output was 1 and should be -1... I thought it meant that an input of 1 should equal an output of -1. Thank you for being really responsive to this thread- sorry for taking up your time! I'll be happy to buy you some beers or something if you ever visit Colorado.
    Cheers! Lance

  • Custom User Avatar

    I'm getting similar problems- I think my code works fine with my test cases...I'm doing it in Python and it seems to be roughly that for every addition of 5 numbers, an additional low number is not summed. Also I got this wierd error:

    example1:

    Random tests

    Testing for [29, 835, -104, 93, 10, 65, -324, -361]

    7

    ✘ It should work for random inputs too: -428 should equal -94

    so with 8 numbers, it is dropping the lowest 2

    example2:

    Random tests

    Testing for [985, -7]

    1

    ✘ It should work for random inputs too: 978 should equal 10000000000984

  • Custom User Avatar

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

  • Custom User Avatar

    I've marked "very" satisfied now. Sorry- I wasn't trying to be a jerk.

  • Custom User Avatar

    Below are the parts of my old code that was raising misleading errors:

    if characters == None:
        return None
    if characters == empty:
        return empty
    characters = str(characters)
    if type(characters) == int:
        return ""
    

    ... and then for the 'count' methods I had it return -1. Therefore, as you can see, if your testing program were to input (1), then I would output (-1) and yet the error message only said "1 should be -1"
    I'd be happy to give a positive ranking if the error message becomes more helpful.

  • Custom User Avatar

    I struggled with this a lot as a noob (in python) because I got some misleading error messages
    (Before I learned I should do if (not characters): return characters (or-1)...)
    For instance, if I made my output -1 when the input was an int, it would say "1 should be -1" even if an entry of 1 really did produce -1.
    Similarly, sometimes it said "-1 should be '' ", even if I were to make it so that an input of -1 really did give ''.
    I'm guessing what happened is that your test would test for an empty string '' and then somehow the error message was "1 should be -1" or something. If possible, it would really help future codewar participants if you could use the same language in the error messages as you did in the kata description. (ex "empty string should return an empty string for viewing and -1 for counting funcs").
    I'm happy to email you some of the submissions I was getting odd error messages, if you think it is worth the time. My email is in my github acct /lanceculnane

    Other than that, I really enjoyed this kata- thanks! I finally got it after I did if not characters: return characters!