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.
Since it's my first kata, I'm not familiar with the settings and how to add some limitation I want.
This kata could be very easy by metaprogramming. At least for me, before I know some characters' length would be changed after
upcase
called, I'd rather use metaprogramming to meet the tests.So, when I created this kata, my purpose is to let challegers know the fact(
upcase
may change the length), without use metaprogramming (see the answers much more quickly).As I mentioned before, I'm not familiar with the test framework of CodeWars, the simplest way for me to avoid metaprogramming is limit the size of code.
This comment is hidden because it contains spoiler information about the solution
Since the kata's description is changed. I cannot approve the translation.
Description cannot be approved, recent changes from related record must be merged first.
I upgraded the description. Thank you for your advice.
I'm not familar with Python meta programming. So I just add a 25 characters restriction to avoid this.
BTW, is it possible to update the kata's description to show different context by language. Since, Python use
lower
andupper
.puzzle
tag added. Thank you for your advice.Ruby translation is wrong for random tests.
For example:
The original solution use a method which will easily cause losing precise.
Now, the test solution is fixed.
Fixed.
Actually, it's a Ruby bug.
https://bugs.ruby-lang.org/issues/17731
Testing for -3160, 721 and 219796573
Test Passed: Value == true
John said he walked 219796573 steps yesterday, and Alice think he is not lying.
Fixed
This answer is not good.
90625 ** 2 == 8212890625