Ad
  • Custom User Avatar

    Python new test framework should be used with assertion messages displayed using the right format

  • Custom User Avatar

    Random tests in JS only generate a fixed range of inputs and regardless of that users can basically hardcode the output since there's only 25 outcomes

  • Custom User Avatar
    • Missing example test in description

    • Should be language-agnostic

    • People will come from any point on the edge and in equal amounts from each point (This part is ambigous and requires more clarity)

  • Default User Avatar

    All good!

    (EDIT: seems I overcomplicated it a bit... ;o )

  • Default User Avatar

    You're right, I was wrong, I finally found (or hope so) the issue (x==0 and x==0 instead of x==0 and y==0, grrr...) and the worst was that the same issue was in my own solution, so it passed the tests successfully.

    This time I think it's fixed.

    Thanks to your time and help.

    ; ) )

  • Default User Avatar

    Errr...

    Presentation: fixed, thanks.

    The "[0,0]" thing: sorry, but the problem lays on your side (be sure that I checked for that before posting the issue! ;p ). See below:

    My code (the relevant part only / nothing else is done in the function, anyway):
    
    def most_customers(dannys_pitch):
        print("danny:"+str(dannys_pitch))
        ans = RESULT.get(tuple(dannys_pitch), [[0,0]])
        print(ans)
        return ans
        
    console log:
    
    Should handle coordinates [0,0]
    danny:[0, 2]
    [[0, 1]]
    [[0, 1]] should equal [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]
    
    Should handle coordinates [0,0]
    danny:[0, 1]
    [[0, 0]]
    [[0, 0]] should equal [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]
    

    So clearly, the input you're passing to the warrior is not what you think it is! ;)

  • Default User Avatar
    Should handle coordinates [0,0]
    

    . . . is the message presenting the case ( here danny's position = [0,0] ) . . .

    [[0, 0]] should equal [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]
    

    . . . is the error message, it means :

    • [[0, 0]] (your output) is the wrong answer and
    • [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]] is the expected one. (If danny is in middle of the square every spot around him will be better)

    I don't understand where the line Danny: [0, 1] comes from.

    It may be a problem of array argument modified somewhere.
    I've tried to fix this kind of issue.

    Also fixed the Fixed/Random tests titling.

    Hope it helps.

    ; ) )

  • Default User Avatar

    Python: something seems wrong:

    Should handle coordinates [0,0]
    Danny: [0, 1]
    [[0, 0]] should equal [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]
    

    => even without doing any calculations: how Emily could be at the same spot than Danny?

    Should handle coordinates [0,0]
    Danny: [0, 2]
    [[0, 1]] should equal [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]
    

    => There, I begin to ask to myself if I well understood the task, considering how the expected result seems... """odd""". :o We're supposed to find the coordinates where Emily will get more customers than Danny, right? (or at least, the maximum possible?)

    EDIT: BTW, edge cases should be part of the fixed tests, not only the random tests (and those (the random tests) are not announced: that is quite surprising when encountering an issue and not finding it at the same place or even finding another one on the next run!)

  • Default User Avatar

    All sorted now, looks good :)

  • Default User Avatar

    That sounds awesome - I can't seem to find it though. Just went through your suggested link and looked in the translations list. Could you resubmit it?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You're welcome!

  • Default User Avatar

    That makes sense - I have changed both now. So it always returns a nested array, and all the answers are coordinates.
    Thanks for you help! :)

  • Custom User Avatar

    That, and in the case of there being one answer, also returning [ [x,y] ]. Always returning an array of coordinates, where coordinates is an array of length 2 (would be a 2-tuple in languages that have them). This makes it a lot easier to work with the answer afterwards.

  • Default User Avatar

    Just to check, do you mean where it says, if they give false coordinates return the string "go everywhere". Replace that with coordinates instead? If so, can certainly do that.

  • Loading more items...