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.
Smart observations: while I think my shortcomings mostly came from translating it while in lunch break (and talking with colleagues, on top of it), I would really like to see your fork/edit for this, once you approve it :)
Aww, come on, don't give up ;) When I wrote the test and the reference solution, I had like 5 hours of ruby experience. So you can do it, too :D
I get a "Parse error: Ruby is invalid." when I hit Test or Attempt.
I guess Christmas is cancelled this year! I knew I should have been better...
Thanks for your feedback. I really messed that up. It's fixed now!
Fixed - thank you! :)
HA! Yes, it had a different name! I decided my original name (
checkScores
) made more sense, since it wasn't just comparing the results.That got me thinking, and I realized I had another bug in my test: it was relying on
assertSimilar
, which (sadly) relies on the key order within an object. Therefore, if (for some reason), a solution had a different order for the results, it would fail while still being correct!I should eventually take the time to fork the kata test suite and add in better logic for testing objects. X-D
Anyway, I fixed that, too.
OK, I've updated it with a better description, as well as moved the function into the test suite so it can be analyzed.
(The function was already duplicated in the full test suite, anyway, to prevent someone from getting too tricky. :-)
Thanks for the feedback!
Oh, thanks, I actually changed how the method worked about half-way through. I probably should just copy it into the example test cases, so it's easier to understand.
I'll clarify it, too.
I have put a note in the description to clarify that.
I have noticed it is not simple to find existing Katas on a given topic. I typically do a search but get no results and suddenly somebody tells me it already existed. I guess it is because not all the time the title of the Katas is clear enough, but I think the search engine needs to be improved. Pretty much like Stackoverflow when you try to ask a new question. It shows you dozens of similar questios that may already answer yours. Perhaps in the future we'll have a feature like that here as well.
I agree I thinks it is very good that the test uses big maps, but I think it should be specified how big the largest map is. This might help people to get an understanding for complexity analysis of algorithms.
Allright, I see that I am a little outnumbered here :). I will add formulas suggested by wthit56. Thank you all for the feedback.
Nebril, this is it. CodeWars is about code, not about a physics lesson. Describe the math and let the coder figure out how to implement that elegantly within the constraints you specify.
Thanks. It's fixed already.
Loading more items...