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.
I added it. I couldn't find documentation for what I should put as the language name in the mark-down, so I assumed "fsharp".
This comment is hidden because it contains spoiler information about the solution
F# translation submitted, please review! :)
My pleasure. If I understand your request correctly, all I needed to do was Edit, switch to the "Test Cases" tab and click "Publish"? I have done this. If you needed something different, please let me know.
You're welcome! The other katas in this series will also be receiving translations as I get time :)
Thanks for the clarification. I missed that part of the problem description. Perhaps we should add that as a static test, not just a random one?
This solution actually has the wrong precedence for the unary - operator. I managed to get it through by running until that random test did not generate. I am about to submit a new solution that addresses this issue.
The random tests that are run on an attempt sometimes runs a test with the format "sqrt(-5&(1+1--1+-1))" with the expected result of "ERROR: Formula / Calculation code 4". Sometimes it caused my solution to fail because it calculated a result, 5 in this example, because -5 squared is 25, the square root of which is 5. I think this test's expectation is based on a negative square root, but when that exponent is even, the argument to square root is no longer negative. I was able to pass the tests by attempting until that case did not come up. Does the & supposed to have higher precedence than the unary - operator, or is this test flawed?
Surely this code has the gnarliest indentation I've ever seen. Seems to have a just a bit of code duplication...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This code almost broke my brain. It's so difficult to understand that I'm not sure whether this was intentionally obfuscated or...