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.
Description should specify that an element that requires multiple reductions adds multiple steps.
According to the spec, given digits should not be
> 9
.Random tests do not conform to description.
Issue raised separately above.
( Haskell, possibly others )
Random tests have arrays that contain numbers up to and including at least
100
.You can always control the input range yourself since it's your kata. Obviously
rounds
will not be negative or non-integer, so why not exclude0
too?Thanks for the suggestion! I will try that now :)
Totally fair - I was unsure of how to address that. It feels like perhaps a rounds value of 0 should not be allowed at all? I toyed with the idea of having it return the value straight out as a list, i.e. 3 -> [3] but that felt wrong as well as it wasn't true to the idea.
btw, the requirements make sense, about the output type, but it's a bad practice to return different data type, depending on the inputs (letting aside the
nil
alternative). I'm really not found of that part.You should put one assertion per actual test, rather than only the failing ones (for now that gives the impresion that there are only 8 tests! x) ).
To do so, and to avoid to disply the inputs, you can use
Test.expect
. Just be sure to provide an assertion message in addition, so that the user gets feedback when a test fails.Thanks for the feedback - I will take the inline bit (Reading left to right, 114 consists of two 1's and one 4.) and place that as a more formal requirement.
Cheers!
It is not stated how the output should be ordered.
Haskell: You should clarify that the first step taken must be
The sum of adjacent numbers
, even if given digits are > 9. And emphasise that you have to reduce to single digit numbers before adding adjacent numbers (19 with added digits = 10, must be reduced again to 1, NOT passed to next reduction cycle)What did you give up on?
Never mind. I gave up.
This comment is hidden because it contains spoiler information about the solution
Loading more items...