Ad
  • Custom User Avatar

    The instructions say "Each element has a unique energy requirement." but Shadow and Light are listed as having identical energy requirements. I suggest you delete the quoted line from the instructions unless you have a solution in mind, too clever for me, that relies on it's truth in which case please make it true.

  • Custom User Avatar

    Comparing floating point by adding an absolute epsilon to one side makes no sense at all.

    If everything always have at most 1 decimal place, either represent it as int 10 times the actual value, or use Decimal. Deal with the floating point errors correctly.

  • Custom User Avatar

    I thought it obvious because the function returns long... long is primitive so no null... what else you could return?

  • Custom User Avatar

    Sometimes the random test will fail because of a java.lang.NullPointerException. I even added a check for whether or not phase1 or phase2 was NULL and still got a null pointer error.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Definitely deserves to be an official kata :D

  • Custom User Avatar

    tests are now wrong:

    compound: FW ; energy: 25.0
    needed: 25.0
    expected:<false> but was:<true>
    

    this should ofc be true!

    And your internal solution is wrong too: you have to use >= not > (even if it's unlikely that it does a difference), and the test for negative values will not take into account the EPSILON, so this is not good too.

  • Custom User Avatar

    Now states EPSILON for user to use in comparison. Also Added Epsilon in Solution Checker and Maker.

  • Custom User Avatar

    and what about the floating point troubles? Because currently, my solution does not what you expect and it systematically passes the tests.

  • Custom User Avatar

    Added Rule "7. If a spell is cast with an incorrect formula (example: W3T5) it will not cast."

  • Custom User Avatar

    since you use non integer values, you should add specific checks for floating point errors, to be sure that it's hendled correctly. For that, you'll have to provide the EPSILON you wanna the warrior to use.

  • Custom User Avatar

    The description of the problem is incomplete: you provide wrong inputs too, but you do not tell what you expect in those cases.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Apologies if I was not visualant but for the Java case. It did not see in the description that it wanted us to output 0 if the string was empty ("").