7 kyu
Steve jumping
Loading description...
Fundamentals
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.
missing it blocks in sample tests
added! thanks
How in the world is (10-3.5)*(1-0) equal 2.5 in the example?
DMG = max(0, (DISTANCE - 3.5) * (1 - DMG_REDUCTION))
['10 D', '4 D', '0 D'] --> 'jumped to the end with 18 remaining HP' #DMG_1 = 2.5 -> 2, DMG_2 = 0.5 -> 0
No need to respond as I figured it out. Maybe let us know that the equation really utilizes the previous "height". Just to vague IMO but thank you for the problem-set
Formula description should be clearer now
N cannot be less than 2.
Description does not mention what does
N
represent. Based on my assumption, it's the size of the array, then you should specify clearly!Also,
in
&out
should beinput
&output
uh, that's because of my changes... x/
Rewritten, thanks
Hi,
Issue part:
DMG_REDUCTION
: in the formula, it's a value between 0 and 1 while they are given as percents just belowSuggestion part:
cases
list). Otherwise, there is no point to that list and you could write all the assertions without it.Cheers
Thanks a lot! Fixed
The input format is not very well specified. What is the data type of
BLOCK_HEIGHT
andBLOCK_TYPE
? It's not clear whetherBLOCK_HEIGHT
is always integral or always non-negative, or what possible values forBLOCK_TYPE
is (the damage reduction part did not say what those are, or made any connection from these values to other parts of the data).Now the description should be clearer. Thanks for all the help!
.
In fixed tests the array used for test block display is different from the input array. Perhaps you should really extract the test method into something like
so this wouldn't happen.
Also, random tests break when input is modified.
Now the tests should be correct.
.
The damage formula as it's written is misleading at best:
(DISTANCE - 3.5)
is not the actual damage formula, that's the first step of the actual damage formula.max(0, (DISTANCE - 3.5) * MULT)
would be the real damage formula. So I think it should be rewritten.Now the DMG formula is correct.
The damage formula can return a negative value when
distance
is less than3.5
, but I don't see any mentions on the handling of this. Clearly jumping on equal ground should not give Steve more HP?.
Returning inconsistent data types is rarely useful. What is this result for? If it's for further processing, a string with a number inside would be inconvenient. If it's for output to the user, a number alone doesn't mean much and it would need to be stringified somewhere anyway.
Thanks for the issue, seems logic
Now the result is only for output to the user