• Custom User Avatar

    Description should specify that an element that requires multiple reductions adds multiple steps.

  • Custom User Avatar

    According to the spec, given digits should not be > 9.

  • Custom User Avatar

    Random tests do not conform to description.

    Issue raised separately above.

  • Custom User Avatar

    ( Haskell, possibly others )

    function countSteps(arr) that takes in an array of single digit numbers

    Random tests have arrays that contain numbers up to and including at least 100.

  • Custom User Avatar

    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 exclude 0 too?

  • Custom User Avatar

    Thanks for the suggestion! I will try that now :)

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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!

  • Custom User Avatar

    It is not stated how the output should be ordered.

  • Custom User Avatar

    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)

  • Custom User Avatar

    What did you give up on?

  • Custom User Avatar

    Never mind. I gave up.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...