6 kyu

Well efficiency calculator

198 of 233Drymonade
Description
Loading description...
Arrays
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ltzyp Avatar

    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) ?

  • ghnoob Avatar

    i have a few question regarding this kata:

    1. why is the FIELD matrix preloaded instead of passed as a parameter?
    2. why is it populated with strings instead of floats or ints?

    also the examples in the description are confusing

  • ejini战神 Avatar

    FIELD in Python && Ruby should be decimal numbers and not strings, with 170++ completion, it is not too late to enforce such changes

  • rowcased Avatar

    C Translation (author inactive).

    • fixes issue with description specified by mauro-1.
    • updates description to be language agnostic
  • hobovsky Avatar

    This comment has been hidden.

  • dfhwze Avatar

    Spec is incorrect, how can a cell be its own adjacent cell:

    you should sum up all saturations of cells adjacent with the specified one
    
  • RealKenshiro Avatar

    What's the point of giving float values with ... strings!

  • mauro-1 Avatar

    Why FIELD contains strings?

  • mauro-1 Avatar

    Description should specify if it's FIELD[y][x] or FIELD[x][y].

  • user9644768 Avatar

    Please use new python test framework.

  • unignore Avatar

    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.

  • siebenschlaefer Avatar

    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 uses FIELD[x][y].

  • lwiyninger-mdsol Avatar

    The description could use some clarification.

  • user9762772 Avatar

    x and y coordinates should be explained clearly. Are they index values? Or something else?

  • hilary Avatar

    needs random tests

  • forethought Avatar

    Creator should add more details to this problem. Even base testcase does not cover much.

  • zebulan Avatar

    PEP8:

    Function names should be lowercase, with words separated by underscores as necessary to improve readability.

    def is_efficient(x, y, threshold):
    

    Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL .

    FIELD = [...]
    OIL_FIELD = [...]
    

    Other than that, nice kata!

  • zebulan Avatar

    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