7 kyu
Dee, The Generous Tipper
118 of 264DiegoSalazar
Loading description...
Mathematics
Algorithms
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.
"She's still single. Like you, probably." Trolling poor coders, eh?
Twenty-first test case not working properly on Ruby? Expected: 5, instead got: 0 when every other test works perfectly fine and idk how the code can be off.
Python: random tests are broken. According to the kata description returned value is supposed to be AN INTEGER, but they expect me to return values in a float form ending with ".5".
In python, the rounds is badly managed
Failed when p = 290, r = -1: 13 should equal 13.5 Failed when p = 326, r = -1: 15 should equal 15.5 Failed when p = 51, r = -1: 1 should equal 1.5 Failed when p = 590, r = -1: 28 should equal 28.5 Failed when p = 711, r = -1: 34 should equal 34.5 Failed when p = 972, r = -1: 47 should equal 47.5 Instructions were to return a positive int.
Failed when p = 305, r = 0: 30 should equal 29 Failed when p = 165, r = 0: 16 should equal 15 Instructions were to round to nearest 10, each of these cases should round p UP from single digit 5, then subtract 1 from T for the 0 r score.
These test cases do not match the instructions in Python 3. Update the translation to have accurate results for Python 3, or restrict to Python 2.
Should be fixed now.
Confirmed. My code works in all versions now. Thanks!
Test case with
p = 565
should be added to the fixed tests to filter "naive rounding" solutions.In fact, there should be a whole separate random tests suite with numbers in the form
p = 10N + 5
as many of these are rounded in a wrong way.With
p = 10N + 5
, Python's default behaviour is to roundp/10
down for even N, and up for odd N. I suspect the errors are showing up because default rounding is being used in the reference solution, and this only causes an inconsistency with the description in the case of even N.Please remember to set rounding mode before rounding so numbers aren't round to nearest even:
http://codewars.com/kata/round-and-round
deleted (I misread Voile's message)
Number of tests increased, so such cases are generated on their own.
No random tests in Ruby.
Two issues:
-As mentioned below, test cases are expecting unrounded numbers for satisfaction of -1
-In the description, numbers ending in 5 are always rounded up, but in the test cases:
Failed when p = 565, r = 0: 56 should equal 55
, meaning that 565 should be rounded down to 56 before subtracting one.Trying to finish this kata in python. Why tests ends with floats, while details says all values of tips are rounded up or down?
Because the translation was written in Python 2.
Python:
@CrazyMerlyn
Should be fixed now.
Haskell : https://www.codewars.com/kumite/5bbacd982ce533f1dd000122?sel=5bbacd982ce533f1dd000122
Already approved.
This comment has been hidden.
The description made me laugh. :-)
This comment has been hidden.
I added some emphasis there. Thanks for the feedback!