Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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
Hey "lanceculnane". :-)
And now you changed it back to "Something"? Why?
I think the error message is really full correct. The value should be equal to -1. Your value is 1. So it is wrong. In the description it is said, that -1 is expectet in the cases of empty and null. So where is the problem?
You have had fun and a good challenge with this kata. So give a "very".
If you think, it was a bad and stupid kata, then give a "stupid" or "bad". But be honest and fair and do not a revenge voting, because your thoughts about the error message are not like mine and like the others.
Have fun at codewars. Learn. And become a wortful member of the great codewars community! :-)
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
This comment is hidden because it contains spoiler information about the solution
I've marked "very" satisfied now. Sorry- I wasn't trying to be a jerk.
I laughed way too hard at this :D.
@lanceculnane
,I did the Python translation for this kata and would try to help explain/fix any problem but your issue description is so vague that I don't know what you mean. The katas description clearly states:
If the string is null or empty, you should exactly return this value for the watch-methods and -1 for the count-methods.
watch
functions:None
, you are expected to returnNone
(null is equivalent toNone
in Python)''
, you are expected to return an empty string''
count
functions will only ever return-1
, if the input string isNone
or an empty string''
.Also, Your code example makes no sense to me? The input argument for the two
count
functions is a single string of characters orNone
, not an integer.I would try to help if you can be more specific about your problem. By specific I mean:
Mark as having spoiler content
underneath your comment (so you don't give away the solution to other users)Thanks!
Really?
you gave a negative ranking because you do not like the error message?
are you serious?
I don't see where is the problem...
What is your concrete problem?
Below are the parts of my old code that was raising misleading errors:
... 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.
Is this why you gave a negative ranking?
Issue?
Where is the problem?
So, all is fine and you solved it? :-)
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!