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.
realy good!
Oh. Okay. I was testing it in
irb
but I guess I did a poor job then :')Looking at
~/.irb_history
, I did use two dots... even though I was specifically wondering about the difference between the two. Sigh.Aight. Send it.
Thank you!
It's not inclusive.
I added the other cases.
There are also some extra edge case tests in JS which are probably worth adding:
Oh sweet. Still reading.
set operations on array? weird language. had to go try it to see if it actually did the right thing x)
one tiny bug:
rand(0...10)
that's inclusive, so that's 11 outcomes where in python it's 10. I don't actually care and will approve that, would be nice if it's the same though.same with 0...5 of course
You're right, and thanks for the feedback. I made them distinct and followed the logic of Python snippet you provided. Check it out!
Hi! I will not dig into discourse to figure out why you're making this, but, the current ruby implementation is obviously wrong so it's presumably about that if I was to look.
So, I'm glad to see this already here.
However. Still wrong. This implementation doesn't guarantee that A B C D are distinct since you pick four random values for them.
One way to go about it is to put all candidates in an array and swap the chosen element with the end and then pop off the end. Another way to do it is to re-try the roll if it rolls an already chosen value - this is typically better when the pool is large and the desired amount of values is small, such as here.
Could you make that update? I'm quite keen to press the approve button after that even if I don't know ruby and will do a poor job of looking it over -- since the current one is entirely broken.
The python version has some additional code related to edge cases that uhm I have no clue if that's good or bad really, but seeing as python is the original language and has the most solve, I would copy exactly what it says there.
this is how it reads there:
The description appears incomplete. It would be nice to describe the requirements for the where method there. For example: “the where method of the AnimalsRegistry class should return a list of all animals with characteristics corresponding to the arguments” and an example of the arguments - something like this, this would save time on understanding the task.
Kata has been updated.
Thanks for your feedback.
not sure include the registry in the Animal class is a good idea
Thanks for the feebacks, description has been updated.
except that, with the current description, the kata actually looks like it's a puzzle until one enters the trainer.
=> the description is missing the actual task: "you have to implement the AnimalsRegistry class" (as in, explicitely)
I changed the kata name to be more accurate.
Tags have been updated, thanks for the feedback.
What does this kata have to do with OOP or
puzzle
? The kata requirement has mostly been sufficiently specified through description and initial code, and there is nothing in the kata that utilizes OOP-specific features.Irrelevant tags should be removed to avoid cluttering the kata search.
Loading more items...