Retired
String Calculator (retired)
679james.brett
Loading description...
Strings
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.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/143.
Please join the discussion to help us identify duplicate kata and retire them.
Retired.
This comment has been hidden.
This comment has been hidden.
It would be good to build the test cases up in terms of complexity i.e. input of "", then input of "1", then input of "1, 2" to let the users build up the algorithm in "true" TDD style.
You could also include negative numbers in your test cases, because you even mention that there could be any number.
That's a great idea, thanks! I've added in a couple of new tests for both 0's and negative numbers.
No predefined Class Kata, just the method, so is the code not compilebar
Could you explain further please? Thanks
I think he means the same issue I was having below that you marked as resolved, but it is not. The default "Your solution" you start with is like this:
public static int AddStrings(string numbers) { // Hack the planet! }
You can not compile it (Run Tests / Submit), as it is not part of a class, you have to manually add it like this: public static class StringCalculator { public static int AddStrings(string numbers) { // Hack the planet! return 0; //just return something so that it will compile } }
I see exactly what you're saying; that's an awful oversight on my part.
Thanks a lot for explaining. I've updated the default, would you mind checking?
Thanks again.
it's good now, thank you!
Missing wrapper class in default solution: public static class StringCalculator
Unless it was on purpose to increase difficulty?
Thank you; I'd used an IDE to compile the solution and hadn't considered this. Solution updated.