Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
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 useDecimal
. Deal with the floating point errors correctly.I thought it obvious because the function returns
long
...long
is primitive so nonull
... what else you could return?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.
This comment is hidden because it contains spoiler information about the solution
Definitely deserves to be an official kata :D
tests are now wrong:
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.Now states EPSILON for user to use in comparison. Also Added Epsilon in Solution Checker and Maker.
and what about the floating point troubles? Because currently, my solution does not what you expect and it systematically passes the tests.
Added Rule "7. If a spell is cast with an incorrect formula (example: W3T5) it will not cast."
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.
The description of the problem is incomplete: you provide wrong inputs too, but you do not tell what you expect in those cases.
This comment is hidden because it contains spoiler information about the solution
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 ("").