Retired

Did I survive? (retired)

Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • webmisfit Avatar

    disliked this kata becouse, its unrealistic to round the incoming damage dont do that

  • zLuki Avatar

    I liked this kata I have to say, good job!

  • JohanWiltink Avatar

    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 for 1 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 to 0, 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.

  • JohanWiltink Avatar

    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.

  • rowcased Avatar

    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?"

    • kuniku Avatar

      thank's for your suggestion, i will change the tittle for sure..

      Suggestion marked resolved by kuniku 5 years ago
    • rowcased Avatar

      Cool, just please take note while offering help in English I misspelled "suvivor", should be "survivor", lol.