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 problem was you used the 'incorrect' order of operations to complete this kata ;) Should be fine now though.
The whites are supposed to be extremely simple.
In my opinion it's too simple to be kata, could for example include some conditional to check whether player is dead/alive, how much health is remaining, how much more damage could take... essentially print some stats :)
No, I tried BigNum but that didn't help. The only one solution that comes to my mind (besides fixing tests) is to write a function that mimic floats rounding of the original platform/ruby version/language.
It's all wrong, the test cases for submit are wrong. Should be something like this.
import java.util.Random;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class PruebasCelsius {
String solution(int temperture) {
int c = (int) ((temperture - 32) * (5/9.0));
return c + (c <= 0 ? " is freezing temperature" : " is above freezing temperature");
}
}
I have exactly the same issue.. Did you fix it?
It seems that hardcoded values in tests are generated in different language than ruby(or on diffrerent platform/ruby version)
as there is small difference in floating-point calculation. Shouldn't those tests just check for the difference and if it's small enough assume values are equal?
example:
Testing for 235
Expected: "112.77777777777779 is above freezing temperature", instead got: "112.77777777777777 is above freezing temperature"