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.
Not sure, just trained this kata. I suggested to add a testcase for this.
It would be great to add a testcase for test_even(2.0)
This would cover the float case better. Many submitted solutions pass the existing tests where they should fail.
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)
I have to say it is a ugly feature of ruby to use
%
for formatting. I would rather usesprintf
or other helper methods to achieve this.I'm curious as to how this works. Any links to what the percent operator does in this case? Whatever it is, it looks fancy and useful.
EDIT: Found it after some tough google work
http://www.ruby-doc.org/core-2.1.1/String.html#method-i-25
The input string needs to be defined more precisely. Input validation needed?