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.
I don not understand why come here to practice and answer just by using built-in methods.
i made a mistake what i did was list.map(regexp)
For some reason, doing this did not work when I attempted it... and only worked once I removed the ampersand.
I'm still not certain how closures work in Ruby... hell, I'm not even certain that is the concept I should be looking up.
did you find out?
Actually, the "Enumerable Magic" katas are explicitly for beginner exploration.
See previous discussions:
WHile this obviously works, I think the point of the excercise was to rebuild this built-in method yourself
You people should really look at the kyu of this kata. It is meant to introduce enumerables to beginners. There are higher kyu katas that explicitly disable native methods to teach other concepts. This is not one of them.
Damn, that's a beautiful solution. Didn't even occur to me to use .scan, and it makes way more sense to calculate averages using overall sums like this.
This solution does what I aimed to do so much more efficiently! Well factored.
"any?" can be defined with "not", "all?", "empty?", without using any advanced technique.
Having a circular mindset leaves you learning nothing, not only in programming but in other domains as well.
This solution is solution of @bellmyer himself (this Kata's sensei)
I disagree.
The spirit of these <8 kyu> kata is basic language exploration, the description contains a direct link to documentation on
enum#any
, and nowhere does it state that the use ofenum#any
is disallowed (nor is it disabled).The purpose here is to teach beginners about
enum#any
, not to force more advanced Rubyists to replicate native functionality.Circular implementation!
That's cheating, using Ruby's internal "any" to implement your "any".
Should you escape the regular expression?
This is awesome!
Loading more items...