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 comment is hidden because it contains spoiler information about the solution
Yes, thank you!
Shouldn't this say 1 argument?
The model solutions returns
Falseforis_factorable([7, 6, 3, 0]), yet$x^7 + x^6 + x^3 + 1 = (x + 1)(x^6 + x^2 - x + 1)$.My fault, I think I have corrected the solution now.
Thank you! I've modified the test to have
fun g (f, x) = f (x, x).In sample tests "shadowing" you have this test:
However, this is also invalid due to
aandbbeing unbound variables. This means the test can be passed without actually handling the shadowing case properly. I suggest a slight modification:I'm not sure why the test case
$x^{1000000} + 1$gives false. It can be factored as$(y + 1)(y^{125624} - y^{125623} + y^{125622} - ... + 1)$, where$y = x^{64}$, can't it?Thank you for the additional tests: I think that your first program never terminates though, so I modified it to
I've added that modified version and the other two tests you suggested.
A very enjoyable kata! One thing which I found challenging is handling conditional expressions. However, the current tests are not comprehensive enough. I suggest adding the following test cases:
Yes :)
At least for sample tests, whe
invalidis expected, is it possible to provide an error message stating why it should be invalid?The syntax you described isn't strictly correct EBNF, but I appreciate the effort-it's still comprehensive and clearly presented.
Yes - some of the input programs, for example
gcd, already has all of its calls in tail position, and a lot of tests areassert.doesNotThrowfor checking that you haven't missed any cases for constructs in your parsing code.Is it expected around 25% of tests pass if I just submit the initial code?
Loading more items...