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.
Haskell translation
The description has been updated to be more language-agnostic and to fix minor formatting/grammar errors.
Fixed by last fork.
Fixed by last fork.
merged
python: Floating point comparison should be used. i.e,
assert_approx_equals
python new test framework is required. updated in this fork
Python: Random tests are vulnerable to input modification
Java traduction
That's a suggestion, not an issue.
The example tests are still using
assert_equals
.I think I've fixed it now, thanks for the note
I had to attempt some 10 times due to differences around the 14th decimal (see below) which made me fail the random test. That was quite annoying especially because used a solution very close to the sensei's. i assume that this is due to floating point calculation errors of the server and not an intended part of the task. i would propose to use delta base test cases ( like assertAlmostEqual(a1,a2,12) )
Apart from that, nice kata.
Fixed it. I used math in my correct solution, copied it over to the Test cases, but forgot to import math in the tests to make my code work without having math in the user solution.
Thanks for the catch!
I get On attempt, I get:
NameError: name 'math' is not defined
(I am not using math, I assume you are in your tests?)
This is just an idea, and may go against what you're going for with this beginner kata, but it could be a good idea to add some larger numbers in the tests to make performance a slight issue.