6 kyu
Level Up!
191NULLHE4D
Loading description...
Iterators
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.
Easy game development concept.
python new test framework is required. updated in this fork
What is the goal of this kata? Teaching bad practices?
This input validation is worse than no input validation.
old kata...
more test coverage on boundaries needed
Swift 5 translation kumited. Please review and approve if acceptable.
If you're doing this much input validation (which I'm not a fan of, but I can set it aside), you're also missing the case where only 1 parameter is provided.
Shouldn't
Make sure you round down the XP required for each level up, rounding up will result in the output being slightly wrong.
be put inside the description and not at the end? Since it's a crucial piece of information.This comment has been hidden.
That's the call that is making your code to fail. What you're currently lacking to solve your problem is knowledge about function arguments in python. => dig into that.
This comment has been hidden.
You know, it could be a code wars issue. I'm trying to issue a print statement in a different kata and I'm getting a server error; and the server has been erroring out at random fairly regularly.
You're not the only one getting that error, i'm almost certain it isn't from my code and i'm not doing very well finding it's source. Everything works fine in an IDE but in codewars...idk. Thanks for letting me know ^^
Hi,
Your code was effectively... wrong! (you were providing from time to time a string to the
randint
function).I found the error, corrected it, and added the fixed tests I suggested below.
Hi,
Your kata needs more test coverage on boundaries and you have an error when checking for level 1 target.
Other problem in the description:
"You have already reached level target_lvl."
instead of"You have already reached level (target_lvl)."
, because I added the parenthesis for nothing, at first.Other than that, enjoyable kata. ;)
Needs a test with
target_lvl = 0
too: see the solution of ZozoFouchtra: the check for invalid input is wrong but it passes the tests.Same about these other boundaries (my first version is wrong but passed the tests):
And these too... (to verify the change of the percentage):
Finally, it seems you have an error in the random tests: I got somtimes this message:
Seems that showes up with this type of entries:
xp_to_target_lvl(False,[12])
I better get going then...i never knew i missed out on so much XD I'm still a beginner so i've got a long way to go Thanks for the heads up...i'll reply again when i'm done
No problem, take your time :)
One advise if you create katas: don't rely on luck, about checking behaviors (meaning: do not put special cases only in the random tests! ;) ) and be thorough. So, fixed tests of all edge cases you may find are necessary ;) And basically, you have to check all the things that are described in the description in fixed tests too.
That is what leads to high quality katas. ;)
EDIT: most of my propositions works with your code (not sure we understoood each others about that so I prefer to be explicit). This is just that they are needed to check thoroughly users codes.
.
Different errors during your random tests, see my code... "True" and "False" as valid parameters, >170 not checked, ...? So for me an "issue";-)
I've fixed the True and False as valid parameters issue. The tests do check if the second parameter is greater than 170, it's just that i assigned a list with random invalid values and the tests would get a random element from it so there is a slight chance it would miss on the element where the value is greater than 170, i'll find a better way to do that. As for the errors during the random tests, they only seem to occur with your solution but i'll look into them. Thanks for pointing me in the right direction ^^
.