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.
Approved by someone
ideally there should be some explanation in the initial code, yes. you can open a suggestion to request that.
Using enums is a great choice when they are supported.
But on Codewars, you don't get the exact definition of the enum, so you need to guess how to use it.
Is it really a good idea to go with that?
because it's better to use enumerated types in languages that support them. the reasons
enum
s are rarely used on Codewars are 1) some translators are not aware of what is most idiomatic in their language of choice and 2) the first languages available on Codewars (JavaScript, Python, Ruby) do not have language support forenum
s¹, so they used string constants instead, and translators to other langauges replicated this interface most of the time.¹: Python now has an
enum
module, but it's a library and not a language constructWhy choose to preload
Color
in Rust rather than useString
, as is commonly done in other languages?Isn't that explained in the Task part?
How does parameter d work? Can anyone explain?
It was supposed to be 9999. It is no longer included in the solution panel.
approved
Ah, thanks - had min and max switched around. Works now!
By the way, I really like the idea of the "You are the author" katas. Hope to see more!
JS fork
Yeah, author's made a typo. I'll try to fix it but it's a bit of a mess.
Anyway, here's the error you should be getting without the
ReferenceError
:PS: I didn't write all the
Test for: n= <some number>
but your solution seems to only return 1, 5 or 3.Getting this error for JavaScript (Seems to be a bug in the test code; My function does not have an "x" variable):
Это супер ката! Столько ловушек сколько их в этом ката я не видел нигде! Я решил эту ката, но мне это стоило 3х бессонных ночей. Но даже после того как мое решение прошло все тесты и было принято, у меня остался вопрос. Почему когда я считаю удары часов в интервале до и после полуночи, я ввожу 2 переменные и присваиваю первой переменной значение количества ударов до полуночи, а второй переменной присваиваю значение количества ударов после полуночи, и потом суммирую значения этих переменных. А если не разделять количество ударов до полуночи и после полуночи,то один удар где-то теряется и результат выходит неверный. Почему так получается , я так и не понял. Если кто-то знает ответ - объясните мне, пожалуйста!!!!!
Approved
Loading more items...