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.
come on, that's better than many top voted ones
looks like code written by someone who doesn't want to get hired or work in a team :)
Revising this kata is not going to work - retirement is final. If and when you publish another first kata, please have some original idea for it ( which is hard! with thousands of kata already published ).
The idea may be inspired, but as a kata on CodeWars, it's not, really. Think of it not as "what can CodeWars do for me" but as "what can I do for CodeWars". CodeWars already has a number of kata that are quite like this one, so it's not adding value to CodeWars.
When you publish a kata, you will be held to the standard of a kata creator, not any beginner, and that standard is high. CodeWars has thousands of kata already, and publishing a duplicate just because you would like to publish a kata ( any kata ) is rightly frowned upon. That is documented. Did you read that documentation? ( It also includes "have random tests". )
That's precisely the point.
-1
is a valid member of the codomain in terms of type ( any negative signed intger is ), but in terms of the value it represents in the real world, it's impossible.0
is a valid value in the type and in the real world, and does not always signal invalid input. You want to make that distinction.Add a test with invalid input, and expect the appropriate output? Don't overthink it.
I'm trying to figure how can I improve on "Sample tests should contain examples of invalid input."
from a definiton of other functions you have a point, from the purpose of the function, to return the number of seconds a video is playing, -1 suggests somebody has a time machine and can go back.
The idea is completely uninspired. Feeling like trolling or did you forgot how it is to be a beginner?
The idea is completely inspired as it comes from real requirement from real project that I or my students encounter at work.
I'll revise regarding input validation. Thanks for your time!
Good pointers! I'll revise.
Then why do we have to accept
undefined
,{}
and aNumber
?This is not completely separate from "don't do input validation" below, but also a gripe in itself. A description should be correct, complete and consistent, and get your datatypes straight!
No random tests
Sample tests should contain examples of invalid input.
Also, 0 shouldn't be the return value for invalid input. -1 or throwing an error would be better.
Loading more items...