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.
You fix the bug, but there is a new bug.
I like the way this solves the problem. Switch/case is such a bulky syntax, and this cleans that up nicely.
@Talrendis Haha, nice one xD
I got it!
I have remembered this 'situation' by a glorious comment from one of community members here commenting some other 8kyu kata:
(you get it? you get it? XD Like, literally returning and literally taking a break XD)
I'm pretty sure the kata is trying to exemplify the case of forgetting the break statement. This solution isn't going to be something newbies can pick that up from.
Fortunately you added Haskell examples to the description, which many people forget to do. Unfortunately you deleted the JS examples, which need to remain. The description is shared by both languages and the non-relevant languages are stripped out by the UI. Please add the JS examples back in. Thanks.
Thanks for explaining, that makes sense.
maybe, but what default would make sense here? the (implicit) default case here returns undefined, which i think is appropriate
Shouldn't "best practice" involve a default case?
I think it would be good with some test cases where random numbers are inserted into the code so people can't map the input against the expected output.
C# translation kumited!
It is a really good Kata but I have found a flaw regarding the test cases for the Haskell version. My solution passed the Kata but when I tried
\[ x \] (x + 5) / (x - 1)
This applied to 3 should equal 4 but my solution returned 0 which means you don't have to push/pop arguments for division correctly. There should be test cases for that too!