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.
Dope!
You need to define the solution function in the random tests (call it
sol
or something) and then test the user's result against the expected (solution).The problem is bigger here, see my issue above
That's because your code is wrong AND the random tests are broken too.
Random tests are comparing the user's results against itself:
See this solution or this one...
it's not about multiplying, it's dividing. I get that the opposite too sometimes ;)
This comment is hidden because it contains spoiler information about the solution
There're already a few very similar katas available. In fact, I wouldn't call it any different from
Multiply
...The values should be compared for approximate equality.
This is way too easy even for an 8 kyu kata.
Please add random tests
Duplicate: https://www.codewars.com/kata/56b22765e1007b79f2000079
Implemented as suggested.
Thanks for giving me a hand with this, might come handy in the future.
Write a reference function and use it inside the assertions (like
Test.assert_equals(get_char(random_value), solution(random_value))
).Or for this particular case it'd be easier to simply save the expected value in a variable (e.g.
expected
) beforehand and then doTest.assert_equals(get_char(random_value), expected)
.Now I got what you meant by useless comments. It was that TODO stuff, no the Test.describe. These are gone now.
Any tips on how should I concele the refrence solution in
Test.assert_equals
?Loading more items...