6 kyu
Well efficiency calculator
198 of 233Drymonade
Loading description...
Arrays
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.
The description does not specify indexing order - x, y vs y,x. Worse, the preloaded tests don't too. So, if you initially chose the wrong order, you cannot understand what is problem with random tests. Could you add such test, please, f.e. (is_efficient(11, 10, 5.5), True) ?
I feel your pain. But it kinda does -- the Description says that it uses x for rows and y for columns. It's messed up, but it is specified.
i have a few question regarding this kata:
also the examples in the description are confusing
FIELD
in Python && Ruby should be decimal numbers and not strings, with 170++ completion, it is not too late to enforce such changesC Translation (author inactive).
Approved
This comment has been hidden.
This comment has been hidden.
Thanks!
Spec is incorrect, how can a cell be its own adjacent cell:
fixed as part of recent Python fork
What's the point of giving float values with ... strings!
Why
FIELD
contains strings?Re-raised as an issue
Description should specify if it's
FIELD[y][x]
orFIELD[x][y]
.fix applied to recently submitted C Translation
Fixed in latest fork
Please use new python test framework.
Done.
I had to look at this discussion to realize there is a global variable FIELD hidden somewhere under the hood. It was not clear to me from the description.
It took me really long to solve this kata in Python because it doesn't use the usual
FIELD[y][x]
indexing, but instead it usesFIELD[x][y]
.The description could use some clarification.
Could you explain, what do you need to clarify?
Not an issue, description is clear ;-)
x and y coordinates should be explained clearly. Are they index values? Or something else?
You're definitely right, I've fixed it. Thanks a lot!
needs random tests
Added in Ruby and Python too. Thank you for remark!
you're welcome. I enjoyed this one very much :)
Creator should add more details to this problem. Even base testcase does not cover much.
I think it is described good enough, could you be more concrete about details should be added?
The description should have some defintion on cells adjacent rather than diagram. For me, the diagram was a bit confusing because ==> was pointing middle row. Even it can have some clues.
I've added the picture that describes adjacent cells better.
PEP8:
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL .
Other than that, nice kata!
Fixed. Thank you for the issue :)
I'm a bit confused about the description. You describe how to calculate the current efficiency of a well, but you don't mention what to do with it after that.
After looking at the test cases, I assumed that you wanted me to test whether or not the current efficiency was greater than the threshold. When I did that, I passed all of the initial test cases. I then submitted my code and failed.
The test case that got me was isefficient(0, 0, 2.3). Since the total I got was 4.17 and the threshold was 2.3, my code returned True. The answer is supposed to be False?
If you could be slightly clearer as to how to calculate whether or not the well is efficient, that would be very helpful.
EDIT: Python version
For the first issue - yes, you're definitely right, it was written badly about what do we need to calculate. I've fixed it. Thank you for the remark.
For the second one - sorry, but the real efficiency at the point (0,0) is 2.2. You can verify it by printing all the field. It is something wrong with your calculations. At (0,0) we need to sum up only 4 points instead of 9 in other cases.
Thank you for the reply! I will go and try to fix my code now. I realize now I have made a stupid mistake, thanks for the hint!