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.
This kata relies on parsing a function's source code and does not have well-defined requirements, and can't possibly. Function parameters can contain arbitrary JavaScript code whose handling would require writing an entire JavaScript parser:
Lua translation!
TypeScript translation (literal translation of JavaScript; author inactive)
NASM translation
No random tests.
Haskell sample tests don't even compile without any modification to the code.
Adding Spec to the module name later fails with:
No random tests.
No random tests.
( JS, haven't really checked Haskell )
Testing is ++BAD. This solution is two thirds wrong, but it passes.
What's wrong with that solution and with the tests is left as an exercise for the author.
Needs random test cases
Some extra tests in Haskell, translated from the ones that @jmjjg created in JavaScript:
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Concerning a Haskell translation: the current version of the kata uses an array, but in Haskell a tuple would be more idiomatic:
However, the Haskell translation would then differ from the JavaScript/Python variant, since it doesn't use arrays/lists. That being said, I would use the more correct tuple variant instead of a list.
Loading more items...