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.
snake case +1
fixed in latest fork
Approved
python new test framework + snake_case is required. updated in this fork
The function name in Python should be in snake_case.
thanks for the feedback - and the suggestion for a future kata. Will get working on it!
The output string seems a bit not logical when
spaces == False
: if spaces are not counted, the truncated output should containmx
characters AND all the spaces before that limit.That would make the kata a bit more interesting... ;) (of course, this would invalidate lots of solutions. You could write a new verison this way and link the two between themselves, in their descriptions).
done - thanks again :)
I enjoyed this, thanks.
Yes, the description is better now! Couple of suggestions to clarify things even more:
spaces
argument isFalse
, you should remove spaces from the"Answer"
.Good spot - thanks! I've updated the examples, hope the description makes more sense now.
Overall, cool kata! I'm still a little confused about when to delete spaces from the input text though. That should be explained better in the description. Is the second example-response in the description correct?
charCheck("Cara Hertz", 9, false) should return [ true, "Cara Hertz" ]
Seems like it should return
[ true, "CaraHertz" ]
according to the actual test cases.I'm still not sure though, more clarification in the description would be helpful.
I had to update my solution and only now actually read the test cases. Great! :]
Also, changed vote and approved. Make more!
Thank-you for taking the time to explain this. I've updated the kata according to your suggestion.
Returning inconsistent datatypes is ++Ungood™ and should be avoided.
You could just as easily have the function return
[ true, "original string" ]
,[ true, "" ]
or even just[ true ]
instead oftrue
. That would enable you to always process the Boolean return value asanswer[0]
. As it is, the function always returns a truthy value and you need toArray.isArray()
(or equivalent) the return value to find out whether or not to further process it. Which is senseless.Loading more items...