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 "random tests" are not really random in Python, JavaScript, Java, and PHP.
Stop resolving issues without fixing them (or even understanding why something is wrong).
Thank you! I'll fix that.
I have no idea why that solution works. What am I missing? I don't allow 4 and 7 in random tests because I've already tested for them, and It's simpler and makes no difference at that point whether or not I hard code it to expect 0.
My bad about randInt, hadn't check your definition.
Check this solution: https://www.codewars.com/kata/reviews/5ff915f245ef420001b27754/groups/5ffcfa45803c080001286509 why don't you allow 4 and 7 in random tests? I think he meant the input is random but the output isn't.
Java and PHP use Expected - Actual instead of Actual - Expected order in the assertions (that's how those testing frameworks work, there is nothing wrong with that), so in PHP:
And in Java:
I can't figure out how to change what each test displays in these two languages. It is just displaying the default for each test framework, so if the default for each test framework is wrong, there's not really anything I can do about that.
randInt never returns 4 or 7. check the definition. And what do you mean not really random? It uses the random functionality of each language.
Actual and expected values are flipped in Java and PHP.
looks like java test output is flipped. this is an issue.
Indeed. But it seems that author simply forgot to generate a new number on
4
or7
, because the expected result is hardcoded to be0
.At least in javascript, couldn't they expect a wrong result too?
Log
number =7
expected:<21> but was:<4>
wtf? by condition it should be 4 if number was 7
Hi, you don't have to parse "array[n]" and "n" into double as there is no loss when passing from int to double (but the reverse is wrong!).
Same problem :c