Beta
Dota 2 Bots - Pudge's Meat Hook
10 of 16docgunthrop
Loading description...
Mathematics
Geometry
Games
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.
There is a big class of edge case missing: when enemy is inside the range and would exit the range before meat hook can even reach the enemy, even if meat hook was fired at
t = 0
. For instance:At level 1 (
r = 1100
) this is outside the circle and takes ~106ms for the enemy to leave the circle, when the hook needs at least ~700ms to close in to the enemy.Reference solution can't handle this properly: instead of returning
null
(the enemy can't be hooked in this case) it expects[[1099, 292], 0]
, which is clearly nonsensical as it is outside the circle.Need to add edge case of pure horizontal and vertical movement for the enemy: this solution can't handle vertical enemy movement.
The
t = 0
test case is not tested frequently enough in random tests (at least not enough to stop me from passing the kata after repeated submissions), and for the 3 fixed tests they can be hard-coded.The link to the embedded video in the description is dead ;-(
Re-uploaded to imgur; used to be hosted on gyfcat but that site had shut down earlier this year.
This comment has been hidden.
For some reason this post never showed up in my alerts / message feed. I may need some time to look over this
I have the same problem with my notifications. No problem.
bump
This comment has been hidden.
Updated Description and added new reference image.
I'm passing every sample test in Python, but when I attempted to submit final I can't pass this test. I've scratched my head and gone over my equations a good amount of times, when I finally decided to graph it in Desmos and notice the 'correct' solution isn't even on the enemy's ray of movement. https://i.imgur.com/hmgnmDo.png
In the Description under the Output header:
In your graph the line passes around the x-coordinate
178.8
, which rounds to179
.Also it looks like the timing for the two moving objects is off for your solution. After finding the slope and distance, we find that the runner reaches the "hook contact" coordinates at the
0.7565852776832743
second mark, whereas the kata has0.7639723325225893
seconds.If Pudge launches his hook toward the point you got, it takes
0.7664464692655989
seconds, which means he misses his target because it's off by ~`10ms. If Pudge launches toward the kata's expected point, it takes
0.7645153431221661` seconds, which rounds to the same time in milliseconds as the runner.Python translation published.
Though my answer was not correct Do you really think that it can reach the target
(1395**2+2534**2)**.5==2892
dst away ?That certainly wasn't supposed to happen; thanks for catching that bug. The issue is now been fixed.