7 kyu
Jacob's Weight Loss Program
332 of 540jeffwright13
Loading description...
Fundamentals
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.
Python fork
The description should specify in which order the exceptions are evaluated and what error messages should be used. In this case,
gender
is evaluated first, thenweight
, thenduration
.In the technical details section/paragraph there is a typo for the word formula. It is spelled "formulae" in the kata
Are you sure this kata is ok? For M 250 5 I got "231.25 should equal 231.8". But when I calculate this on my calculator I also get 231.25, there's no way to get 231.8 with those inputs so I think those tests are off.
Having the same problem right now..
its like the compound intrest formula you have to iterate problem based on the weight you ger week by week
double random incorrect and i somehow must know that i should output 'Invalid weight' instead of 'Invalid duration', wtf...
Exception messages aren't detailed.
At least note the language, and be specific about the issue, "lacking detail" isn't actionable.
I don't think error messages are language specific. In this kata, result is rounded before assertion, which makes debugging nearly impossible due to small coefficients involved. Printing parameters and result before rounding is a good start to provide enough details.
Ruby :
the sample tests won't run, they have syntax errors
the description isn't clear on the order of the validation
the description also doesn't give the correct expected return value
Exception messages aren't detailed.
That isn't an issue, unfortunately it is commonplace.
The description says:
But the tests expect the final weight of the person.
I suggest description is changed to:
Updated.
JS and Ruby translation submitted, if you want to approve them; during the translation the servers didn't seem in top shape, so feel free to let me know if you encounter any trouble!
Oh, also: I think your last two sets of tests are computing the same test over and over again for 50 times; you should create the random parameters inside the loop, possibly.
Translations (blindly) accepted. I will have a look at the tests soon.
Thanks man; a little more testing and I will be glad to greenlit this kata :)
OK I refactored those tests. They pass for both Py2 and Py3. Have not tested the JS or Ruby translations though.
I made a slight change to your katas tests so it will work for Python 3 as well.
Instead of
string.letters
(Python 2 only), I made itstring.ascii_letters
(Python 2 & 3).Hope you don't mind the change. I just saw a message about Python 3 support and wanted to try it out!
That's great - thank you for the improvement.
No random tests.
I'm working on incorporating some random tests now...
I have incorprated random tests. I hope this meets your expectation.
They're great for a first for a first kata. However, there's one thing you could probably add: invalid weights/durations in the test cases for gender/weights.
This comment has been hidden.
That's one negative per test. You don't have a check that manages multiple wrong arguments, e.g.
Added in tests for multiple incorrect inputs
It does not make sense, since we have no idea what order does the problem want us to give the results in.
Nice and easy kata =)