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.
hahahah that is cool
I love it! That is a generalized solution that works both for this kata and for an arbitrary number of divisors.
thx
I'd recommend going through the methods of Enumerable (see http://ruby-doc.org/core-2.3.1/Enumerable.html) and practicing usage of each one so you can get familiar with them - most of these methods are very useful in the real world and for code kata!
really? I need to learn all documentation, 'couse my code is so long in easy situations
Not sure, just trained this kata. I suggested to add a testcase for this.
It shouldn't!
Maybe you're thinking of
.eql?
:Edit: just observed that floats should be considered uneven for this, so I eat my words! Has the kata changed since it was originally written?
This would fail test_even(2.0)
This is a good solution, but the kata instructions are:
Create a function isDivisible(n,x,y) that checks if a number n is divisible by two numbers x AND y