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.
Sorry about that, should be fixed now!
The input number will always be in the range of 0 < num < 1,000,000,000,000
This statement is incorrect as random tests can go beyond this range.
Thank you very much for all of these tips! I'll be sure to change this soon!
This is generally a very bad way of doing random tests, because probability of testing interesting inputs is close to 0. For example, there is ultra small chance of having a test for numbers < 1000, and very small chance of having a test for trailing zeros. You need to have better random generators to ensure good coverage of tested scenarios. You can take a look at example kata, especially the "Leap years" one, to see how to ensure good distribution of tested scenarios.
Trailing periods are still not explained, and not tested. Inputs in form
10000000
have no fixed tests and no random tests.Should be fixed now!
That's OK, we've all been there.
MAke sure to test for scenarios with different amounts of trailing zeros, like: 100000, 12000, 12300, 100001, 120001, 123001
Sorry that's just my stupidity in writing the description, can you tell it's my first kata? :)
Example in description:
1000000 -> "1.000e6"
Tests:
It should be explained how trailing zeros should be handled, and there should be explicit fixed tests, and guaranteed random tests, for inputs with trailing zeros like
1000000
and1000001
.Thank you for the feedback, clarification has been added to the description. The digits should just be truncated / rounded down.
The description needs to specify how to handle rounding of the last digit. For example, what is the expected answer for
2345678
, or999999
?Thank you for the tips, they are very much appreciated!
This comment is hidden because it contains spoiler information about the solution