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.
shouldn’t this kata be tagged with regex?
I am seeing 👀 many people upvoting 🗳️ the single-line solutions.
Whereas It not a recommended practice where there are many operations are going on.
Because it compromises the code readability.
What do other people think ❓
single line solution should be supported and recommended or deserve downvote ❓
Needs a fixed test
Test.assertEquals( f("AAA"), "a_a_a" )
.Fixed tests are too weak.
No random tests.
Hello, Olga! Thanks for the nice kata! Need add into test cases two-digit numbers or more.
to_underscore(42)
;to_underscore(111)
, etc.I believe the test suite and description miss an important PascalCase -> snake_case scenario: multiple capital letters in a row.
As I understand it, 'ThisHHHasManyCapitals' should yield 'this_hhhas_many_capitals', not 'this_h_h_has_many_capitals'. Along the same lines, 'CSSSelector' -> 'css_selector.'
As it stands right now, all of the top voted Ruby solutions fail to translate 'CSSSelector' et al. correctly.
Don't take my word and please correct me if I'm wrong, but i believe its not a good practice to pass
string
toto_underscore(string)
due to built in module. Im not sure howimport string
going to behave now.