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.
OK. Solved it in quick and dirty way. As tests are ... there are no tests for Bash. The problem was with kata's wording.
The author writes: "Your task is to write a function that takes a string ..."
A function!!! WTF! What he/she really wants is just a command with args, not a function!
To solve this kata in a proper manner just write a command, not a function. That's it folks!
In Bash it should be
func_name(){echo "${*}" | and here command that devowels input string}.
I know it, and it works in scripts. Been writing for years.
But how on Earth is it to work here? Please, help with a hint.
I do know the command itself. It's not sed params, them I know.
I am interested in syntax. Tried it with an old format (function func_name {etc.}). Didn't work either.
Example for plural endings in Russian (hour - hours, minute - minutes):
1 час -
2 часа -
5 часов -
1 минута -
2 минуты -
5 минут
Thanks. I do know about documentation. Please, take trouble and read it (your link). From the first page you've got try:/except: examples of raising ValueError. What I suggested, might improve this kata and Codewars in general. If there would be less trouble with single instances (katas), the better resourse it would be. Yours (1 kyu rating) is not for being toxic, right? :-)
OK. Not everyone (1 dan) yet here. Searching for 'raising ValueError' and code skills previously learned lead people to try:/except: solutions. None of which, obviously, works.
And these katas are for codders who are not expert-super-duper pros. They are for novices. That is why a helpful hint in description of the kata, or a hint in test evaluation would be much appreciated by them. To that, I admit, that I confused "raising an error" with "handling an error". Now will remember the difference. Thanks.
Was really confused by "raise ValueError" part. Tried to do it as usual in try: except: blocks. The code worked fine locally, but not here in Codewars. This kata tests should either include tests for another methods of raising ValueError or change description. For codders to come: do not use try/except here. You'll find the right way quicker to get through this kata.