6 kyu
Old Mobile Display
98 of 208mmalkavian
Loading description...
Strings
ASCII Art
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 new test framework
JS fork
and what to return if n is below 20 or n is above 100?
There is no upper limit, the description simply states values in tests can be big.
the least 20 characters or least 30% means thats the lower limit of the display, any values less than that should be considered to be 20 or 30%
че ты высрал
The centering is inconsistent with the "reference"
str.center
. The kata should be either updated to make it consistent about that or the expected centering should be clearly stated.In addition:
fork addressing all those
I'm not sure i'd consider that a "fix"... Falling from my bed, I have no idea what you mean here.
it's not in my fork, it's in the original description
I don't see how the fork can "address all those", then, since this is a JS fork while I'm specifically talking about python, there. Did I miss something?
The description is shared across languages. It is you who complained about unclear specifications.
Python translation (version 3.4) There is a floating point error in kata test function:
Parameters: n = 85, p = 140 So height is 119 lines (no decimal) But in test function, it yields 118.999..., then truncating to 118 lines.
Height calculus must be change from
to
You are right lechevalier, I added a small hint in the description. Although I want you to notice that these are some few corner cases.
Considering a range from 20 to 150
We'll get :
a small python glitch, but indeed a good catch.
Thanks for the scale but actually dividing by p, then multiply by m returns a "wrong" result. You need to correct test cases by the suggestion I put. As this case is rare, there will be nearly no impact on already given solutions and future solutions will always be correct.
I did modify the tests, the code validates but it won't let me publish it.
That's strange, I had this problem too when trying to edit the old kata Character Counter and Bars Graph.
The approximation float-integer is an old-time problem and python is not exempt by it. I've used the int() approximation as a reference to avoid users to figure out how to get those numbers by struggling with hideous ceil(), floor() and round().
Good practice indeed. Don't forget to multiply first instead of dividing, even if your numbers are big: Python handles better big integers than small floating point numbers.
However here, as CW doesn't allow the modification of your kata, I'm betting on a problem with python handling.
@mmalkavian
CW issues seem to be solved, could you try to edit now?The test case should need a double check for random numbers. I had 129 for "n" and 19 for "p" but the result that was given had like 38 lines, wherease it should be 24?
Thanks for your answer in advance!
P.s.: Nice kata!
This comment has been hidden.
I apologize if I misunderstood, my english isn't quite so good, but I believe that this part of the description might be misleading, ambiguous, or at least hard to understand:
I say this because the CodeWars logo actually isn't always in the middle horizontally. I took some time to figure out that, when 'n' was odd (of course), I had to actually put it always in the first horizontal half for achieving the right solution.
Take a look at your examples, specially at the one with (25,30). CodeWars is 8 characters away from the left border, and 9 characters away from the right border. Counting the 8 characters from CodeWars, we have 8 + 8 + 9 = 25. This isn't middle, this is first half.
Although this, I enjoyed a lot your kata, keep up the good work. :)
Excuse me, you are aligning the "C", I'm aligning the center of "Codewars", the "ew", there's no more middle than that.
This should be a question, not an issue; more so, if you already solved it.
Thank you.
[nothing]
Nice kata! Thanks!