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.
tests are wrong: they look for an add function with diff params
description says input is always an array not including non integer or non float elements. test case passes just a string
This comment is hidden because it contains spoiler information about the solution
Use Test.assert_equals
The author has been inactive since January 2014. As I see, many of old Ruby katas have have poor quality according to today's standards. I'm not sure if it makes more sense to fix or to retire them. (Btw. in Python this would be max 8kyu :))
@max30272 it really should. The description explicitly hands you the math to peform, so the kata boils down to two very basic "how do I X in ruby?" questions, and if your solution is more than 1 line you're doing something very wrong.
It should be 8 kyu. :(
Added various other dice to tests
Updated description and added sample and random tests
Re-ranked to 7 kyu
Fixed
Too easy to be a 6kyu
The description is poorly formatted, introduces the problem in a somewhat awkward order (e.g., listing expected output before explaining what the input is), devotes way too much space to irrelevantly listing permutations which might mislead someone into thinking they're expected to return those, and there are no example tests to clarify what is expected.
At the very least, that long line (without breaks, making it even less readable) that reads:
all_possible_outcomes_of_multiple_trials(coin, 2) should == 4 all_possible_outcomes_of_multiple_trials(coin, 3) should == 8 all_possible_outcomes_of_multiple_trials(dice, 1) should == 6 all_possible_outcomes_of_multiple_trials(dice, 2) should == 36
should have been turned into example test cases and placed in the test section.
expect
shouldn't be used on values that can be tested with equality. UseTest.assert_equals
instead.Loading more items...