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
Johan, I appreciate your thoroughness :p
My Haskell and Python solutions are similar algorithms, and I can see Python solutions that are effectively brute-forcing the solution space. On my machine, testing a similar Haskell algorithm with no reference solution and the current test setup (i.e. testing the runtime of these algorithms) ran for three minutes before I stopped it. For 100 tests, your solution runs in ~0.04 seconds, while mine runs in ~61.
The current Haskell test fixture is much more stringent than Python's. I'm using
Test.QuickCheck
to test it, while the Python tests are custom rolled and much smaller. I'm tempted to change the reference solution to yours for the time being, and then try to update the Haskell tests to be more like the Python ones. I'll resolve this issue once I rework the tests. How's that sound?Done. I apologize for my inexperience, and I massively appreciate your help and feedback with everything!
I believe this has been fixed now. If you provide a
Just answer
value, the tests will validate this solution; providing aNothing
value will still run the reference solution to check that there truly is no solution.The first iteration of the Haskell translation had 30 random tests, but for whatever reason (perhaps due to upgrading to
GHC 8.8.4
?), I've had to lower that. This might also be fixed by optimizing the reference solution, and I may try that later.If a variable is not assigned a value in your answer, the tests will assume any usage (whether it be
-x
orx
) isFalse
. I can't speak to how the Python tests approach that, so I'm hesitant to edit the description.Please verify it works, and resolve the issue if so.
Fixed.
This should be fixed now. I'm not sure what kinds of edge cases need to be added, and I haven't messed with
Test.QuickCheck
before, so I'm not entirely sure how to fix that issue.Haskell translation submitted, please review and approve.
On second thought, this would break functionality with
(>>>)
, so don't do it. If we change the type as suggested, this:would turn into this:
Effectively, this would prevent the use of
add
andduplicate
, because it would always require thereturn ()
tacked on.Thanks for the feedback! Appreciate it.
Python translation written, please approve!
Ah sorry, here it is
Python translation created! Please approve.
Consider changing the types of
add
andduplicate
from what it is:to this:
to be more indicative of intended behavior (namely, that they never terminate).
Love this kata!
One question: Can somebody point me toward a resource that helps with the
jane.can
functionality in Python? I keep getting aNameError: name 'name' is not defined
, even after defining it in the global namespace. Any help is appreciated!For your fourth bullet, the "should work for random tests" shows up if the user fails a random test. I suppose it isn't strictly necessary, but it's more descriptive than the default message.
This is my first kumite that I've actually finished, so I'm not sure how to deal with the random tests. If you have any suggestions, let me know or feel free to implement them yourself!
Loading more items...