6 kyu
Timer Decorator
Loading description...
Fundamentals
Design Patterns
Object-oriented Programming
Date Time
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
If you have failed tests starting from the 6th test, and you dont have any idea what's wrong, you should know that:
Note to kata creator: Kata instruction is not full, there is nothing about that conditions (please complement).
The test needs to include functions with named parameters because currently a solution that ignores named parameters still passes.
It would be much better to have logging for failed test cases input values
as it is pretty hard to debug and underdsand which value has failed
Test Passed
Test Failed
True should equal False # ???
I've seen other katas tests support this feature, e.g.:
test.assert_equals(number(["a", "b", "c"]), ["1: a", "2: b", "3: c"])
fails with:
Should handle ["a", "b", "c"] as ["1: a", "2: b", 3: c"]
['a', 'b', 'c'] should equal ['1: a', '2: b', '3: c']
is that the 6th test, that you're failing?
I tried to perform some experiments and used
datetime
module instead suggestedtime
. And correct, all tests starting from 6th started failing for me, but I was unable to get a glue what happened there under the hood.if all tests starting from the 6th are failing, that means your code is incorrect. You should print stuf to the console: the limit and the timings you use. Check that the precision is good enough with what you use too.
I've already submitted another successful solution. Just wanted to notify creator of this kata about minor inconvenience during failed tests debug (in comparison with other katas).
Yeah, printing input values is a nice workaround, btw.
Needs random tests (Cause my cheating solution shouldn't work :)
It would be better to clarify: "within a given seconds interval" means < or <= ? Surprisingly, both variants are acceptable now. Was it intended? ;) And tag "Dates/Time" will not be superfluous. Thanks for interesting kata!
Hey sperry, thanks for the kind words!
I added (less than) to the description to clarify what I had in mind. It was intended to be "<" and I put that in my solution. I'm afraid it could be hard to check when it comes to time and Codewars, as the result may vary, and so on. :)
I also added "Dates/Time" tag.
Cheers!