Draft
Feed The Dogs
15 of 17pablo.js2
Loading description...
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.
The random tests still print this instead of input:
Undocumented behavior:
I solve all sample tests but practically none of the random tests (Python). This means the sample tests are not a good representation of what to expect in random tests.
Solved some problems in the python solution:
Python random tests have cases with one dog
In python function name should be snake_case (feed_the_dogs).
Python: the random tests print something else instead of the function arguments:
Have you checked why the solution in the question below doesn't work?
why the dogs[2] don´t move to the nearest food on 3? in the description say: HOWEVER, if the two dogs surrounding him are at the same distance away from him, then the dog will be confused and he'll stay in place, losing his turn to eat for that round.
perhaps that is the problem
Why
feed_the_dogs([2, 5, 1, 3], [1, 2, 2, 0])
should be[1, 2, 3, 1]
(from random tests)?I also end up with
[1, 3, 3, 3]
. I think this kata does not follow its own spec.In python function name should be snake_case (
feed_the_dogs
).Fixed!, Thanks
Python random tests have cases with one dog.
I solve the issue in a fork, but don´t seems to be enough to mark it as resolved. What i do bad?
.
Python: the random tests print something else instead of the function arguments:
I fix all the issues long ago, but i can´t mark it as resolved. :(
solved, ty
I can't believe someone made a kata about "What the dog doin"
There are still some solutions passing when they shouldn't
Fixed, thanks!
No fixed, sorry!
Fixed!!
.
Small typo:
should be
Fixed, thanks!
For the sample test:
[0,1,2,3,4], [2,2]
Turn 1: Dog 0 eats in pos 2 ->
[0,1,1,3,4], [2,2]
Turn 2: Dog 1 eats in pos 2 ->
[0,1,0,3,4], [2,2]
Turn 3: Dog 0 sees food in pos 1 and 3, but both are the same distance from the other dog -> Stay
Turn 4: Dog 1 sees food in pos 1 and 3, but both are the same distance from the other dog -> Stay
Repeat ad infinitum
What should the dogs do?
The problem finish when:
The solution of the case must be: [2,2]
Then why is the sample test asking for
[4,4]
?test.assert_equals(FeedTheDogs.feedTheDogs([0,1,2,3,4], [2,2]), [4,4])
Is an issue. I asked for remove this case in the java version. I notified that must been removed from python too
Fixed, thanks!
.
Modifying the input will break the random testing, like this
Fixed, it was an issue with identation on the tests. Thanks!
I still see those solutions as valid, this doesn't look fixed.
There are solutions that doesn't pass the sample tests but pass all the random tests, so the random tests are not good enough.
(Also, actual tests should contain all the fixed tests in sample tests, and possibly more. Random tests can't catch everything.)
Thanks for the feedback. There are now more tests that handle specific cases, including those shown on the sample tests.
Seems like Python version isn't updated.
Description of the task is lacking a lot of details and the examples aren't helping at all:
Left to right in location, or in the input array?
Do you mean "closest non-empty bowl"?
What is "another dog"? Does the dog itself count? What if the bowl is already occupied by other dogs? What if there are no other dogs (because only 1 dog exists)? Also what happens if they are also the same distances from another dog (which happens often as bowls are usually occupied with dogs)?
(btw, typo:
reasses
->reassess
)Does this mean "there is a dog both on the left and right with the same distance away from him"? "Surrounding" would give an implication that those dogs have to be adjacent.
So this applies to bowls with food as well? The dog will just skip its turn entirely?
Immediately, or after a round? Your examples only shows the state of the bowls and dogs after every round, but most things are decided at the scale of every dog's turn, so this is confusing.
Also, I think it's better to specify the configuration of the bowls. It could've been circular and loop from both sides.
The description has been updated. Hopefully instructions are clearer. Let me know if it needs any other fixes. Thanks!