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.
In the description, the sentence "The initial string will contain at least two words, otherwise an empty string will be returned" is a bit confusing.
"The initial string will contain at least two words" sounds like you make a statement about the types of string (testcases) that will be input in the function, so that you do not have to check for exceptions. This is somewhat clarified with the "otherwise" part, but an overall better phrasing might be:
"If the initial string does not contain at least two words, an empty string will/should be returned".
This special case also does not fit the other results this function returns. When balancing a string that has only one word, should you not just return that word itself instead of an empty string? Or the word follwed by a second, empty line? Might depend on the use case for this function, but at least that way, you would always return every word of the original string without deleting anything. If you did it this way, you could perhaps even omit the whole point, as it would be included in the last one:
"In case of conflict or doubt, the first line will be the longest."
Ok. I did it.
Thanks for your suggestions!
point 1: yes, there are in the full test suite, but I meant that this kind of test should also be in the example tests.
I have done points two and three.
About point one: there are already some example tests. Can you clarify?
Thank you.
Hi,
Missing
fixed and(oh, you actually have the equivalent in the full test suite) example tests:Chai has to be used, not the old test framework (JS)
please remove the long useless line of words for the random tests: it breaks code mirror coloring, making the tests harder to read. The random tests don't have to use acutal word (well... 'lorem ipsum' stuff anyway) so ""words"" could just be a random (non nul) number of random letters smashed together
Cheers
I have made some modification. I hope it's enough.
Thank you!
Please format the description using the correct code
Thanks for the comment. It's already changing.
Thanks for the comment. It's already changing.
Also, this is not conforming to C# naming convention. C# namespaces should be in camel case, like
BalancedTextInTwoLines
Initial code has incorrect namespace:
Balanced_Text_In_Two_Lines
->Balanced_Text_Two_Lines
for sample tests(Actual tests use yet another namespace for some reasons)
For one thing, it does not have random tests, which is often automatic downvote for some reviewers.
The kata was auto-retired due to low satisfaction rating. See https://docs.codewars.com/curation/references/approval-retirement-criteria/#auto-retire.
The kata was retired but I don't why?
Does anyone know why?
This comment is hidden because it contains spoiler information about the solution