Beta

Counting Digits

Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Blind4Basics 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.

    • Blind4Basics 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.

    • Leadboy 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.

    • Leadboy Avatar

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

      Suggestion marked resolved by Leadboy 6 years ago
    • Voile 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?

  • FArekkusu Avatar

    It is not stated how the output should be ordered.

    • Leadboy 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!

      Issue marked resolved by Leadboy 6 years ago