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.
Shell translation
python translation waiting approval, please.
https://www.codewars.com/kumite/662d35762158e60044357e09?sel=662d35762158e60044357e09
C#: method name should be
PascalCase
(Please refer to implementation of backward compatibility here )Sample tests should include case where numbers are diffent, but they're both either odd or even.
For instance Ruby:
Test.assert_equals(lovefunc(7,5), false)
or
Test.assert_equals(lovefunc(6,8), false)
Sample tests are passable with simple "value1 != value2", although they obviously fails the attempt and they would also fail if any of two examples above would be added.
Multiplying numbers and rounding to decimal places has already been done to death.
Needs random test cases
This comment is hidden because it contains spoiler information about the solution
This kata doesn't use any random tests yet. If it would use random tests and/or numbers up to
1e+50
you would notice that some solutions don't work due to the different order of fractional operations:Instead of a string based test, a relative error comparison would be more adequate, e.g.
That way people can concentrate on the mathematics and don't need to worry about the order of their multiplication.
PS: @Giacomo, @Zozo: Does any of you remember where I've used
assertFuzzyEquals
before? I can't find the kata.