Retired
Did I survive? (retired)
33kuniku
Loading description...
Fundamentals
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.
disliked this kata becouse, its unrealistic to round the incoming damage dont do that
I liked this kata I have to say, good job!
Rounding is not the correct way to handle floating point representation inaccuracy. Comparing with a margin for error is, but that's impossible if you want some arbitrary alive / dead cut-off.
I know rounding hitpoints is common ( Hell, rounding numbers in general is common ). But the way it's implemented now ( rounding down ) means you are not testing for
0 or less
hitpoints for death, but for1 or more
for survival. ( See my solution. Note I don't round. )If you feel an irresistable urge to round, round up. That way, you will at least test for
0 or less
for death. You will also occasionally get protests from people who do calculations in a different order, arrive at some value very close to0
, round wrong ( well, the other way than you ), and end up at a different answer than you. This is always a problem when dealing with floating point values; it has always been and it will always be. Floating point values inherently have some inaccuracy, and doing calculations with them amplifies that inaccuracy.i've added fixed test for Dead!, Survived!, and
0
I don't think you understood the problem if you think that's the solution. :[
why he rounding the incoming damage i dont know, its unrealistic so i agree with you
Please don't log anything in testing. Use headers or let solvers do it themselves. This is confusing.
Please use the most recent Node version ( which also means, use
chai
). There is no good reason to use obsolescent versions.i've change the node version to 12.x and test to chai
For the title to be correct English, please consider choosing from "Am I a suvivor?", "Have I survived?", "Did I survive?", or "Will I survive?"
thank's for your suggestion, i will change the tittle for sure..
Cool, just please take note while offering help in English I misspelled "suvivor", should be "survivor", lol.