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.
OK, got it. I was running into an unexpected "feature" of reduce that I was unaware of.
Inelegantly solved. Thanks for your help.
I thought it would count as an issue as it was giving an error message rather than simply telling me that the code failed a test. I don't get this error message in the REPL on my own machine so it seems to be particular to the site. But I take your point!
I doubt that the reduce function is the issue, given that it passes all the random tests, but I'll try and alternative solution so see if that works better. Out of interest, how many tests are there under the
should work for some examples
section? I see four passing tests, then an error message, then all the random tests passing. Is it failing on the fifth test maybe?I'm trying to do this kata in F#. My code passes the sample tests and all the random tests but it gives the following cryptic error message when doing the first part of the automated tests:
I can't tell from this if there is a problem with my code (an edge case I've not considered) or if there's a problem with the tests themselves. Can someone please clarify this?
The tests for JavaScript are incomplete and are accepting incorrect submissions. For example, if we try to calculate
decompose (9927447)
, the second-from-top submission returns the incorrect answer[ 1, 2, 3, 5, 6, 7, 88, 4455, 9927446 ]
, the third returns the correct answer[ 1, 3, 17, 87, 4455, 9927446 ]
, while the top answer causes a stack overflow!I only discovered this after my incorrect algorithm was accepted, but the R version failed the unit tests.
There's a problem with the sample tests for R. I got the following error with the second test:
Test Failed
abs(rolldice_sum_prob(8, 2) - 0.13888888889) is not less than 1e-12. Difference: 1.11e-13
But the same code passed the final tests.
The tests don't match the specifications. Most of the accepted answers for JavaScript would fail if the tests actually tested for punctuation.
The tests for R are broken. The basic tests look for the function sum_mult(), but the main tests look for sum_mul().