Beta
Counting Digits
31Leadboy
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
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.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.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.
Thanks for the suggestion! I will try that now :)
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?It is not stated how the output should be ordered.
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!