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.
This comment is hidden because it contains spoiler information about the solution
is it common to mutate function arguments in ruby?
I'm coming from the JS world where immmutability is the key to sanity
EDIT: think i got it - we can sort and reverse in place since chars returns a new array. No args are being mutated
This comment is hidden because it contains spoiler information about the solution
Did you ever figure out what was happening with this? Why was it blowing up with large numbers?
Maybe I'm mistaken... but isn't it still monkey patching to reopen the class and alias a method?
I disallowed
alias_method
because I wanted the users to use monkeypatching.On the other hand, I don't want them to actually provide their own implementation of
upcase
because it's beyond the point of this kata, ie. to show a Ruby language feature.It's just to use monkeypatching and not to provide your own version of upcase. :)
This comment is hidden because it contains spoiler information about the solution
I agree with others that just calling
upcase
should be disallowed.Especially since you disallowed the use of
alias_method
.If you are going to disallow this then you should disallow
upcase
because otherwise all you are doing is aliasing in long hand.I am geting the same for
reverse
NoMethodError: undefined method
reverse' for 0:Fixnum`I agree it should return a
Rational
notnil
especially since this is meant to emulate the**
operator.I did the same thing although there is no need to switch back to int
0.0 == 0 => true
Am I the only one that used parallel assignment for this?
I agree since I have seen solutions using an inclusive range which according to the Kata is incorrect. Seems strange that it is a spec but is untested.
When I try to submit I keep getting "Failed to construct test fixture properly. Did you provide test cases?" Any idea why this is happening?
For Some reason this also occurs when I add
Test.assert_equals(solution("MCMXC"),1990)
to my tests.All other tests work fine but as soon as I add this test I get the same error.
My solution seems to work for all of my tests and I would really like to submit it as I love seeing other peoples solutions but I don't want to forfeit which is currently my only option.
Please resolve this.
Loading more items...