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.
There is an added requirement for Elixir, to accept a completely different data type in the event of an empty list. This seems oddly specific and unnecessary. Perhaps the author thought they were making things a little easier, since splitting an empty string results in a list with a single empty string, and that might break some implementations.
But the correct approach is for the function to properly handle an empty string, not to force the user of the function to send a different (somewhat arbitrary) data type. In fact, if the user is already checking for an empty string themselves, there would be almost no need to call the function in the first place.
So I feel like this is encouraging a bad practice of pushing some of the function's responsibility onto the user of the function. I also think this should maybe be a 5kyu.
Sorry, you were absolutely right - I didn't look closely enough at your first comment. I've fixed that test, thank you!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Yes, so are 3 and 5. The test says that you should SKIP prime numbers, so the only one left is 8.
These are intentionally simple, so developers new to ruby can learn. In fact, I've been using these to teach 10-14 year olds the ins and outs of the Enumerable module, because it opens up so much they can do in Ruby. They have a very low kyu rating to reflect that.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I like the level it's at - if you're not familiar with ruby indexing, it's a good beginner kata without adding restrictions. And the reason I didn't say "array" is because I want new developers to get used to hearing real-world descriptions. Your boss/client won't ask for an "array" of customer names, for instance. I want the developer to figure out the rest, and I use the example tests to ensure they know exactly what's expected of them.
I disagree. I don't see any 8 or 7 kyu level fibonacci kata, which is a shame. The fibonacci sequence is so easy for newcomers to grasp, it's a great exercise. But the other fibonacci kata out there require more sophisticated solutions in order to calculate very high values in the time allotted. I think there's value in an entry-level version like this one.
Thanks, this is fixed now!
Thanks, I did that just now. I chose to keep things simple and explicitly require only symbol support.
Yeah, in ruby
nil
andfalse
equate to false, and everything else (including 0!) are truthy. The zero thing causes some fun bugs for beginners :)Excellent suggestion, I just added this!
Loading more items...