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
Hand
can contain any number of cards", so random testing works correctlySorry, forgot to mention that if two hands are equal, first hand should be returned
You are right, thank you. But validation can run tests, if there are example tests, i.e. example test field is not empty
Such behavior would prevent some errors in example tests
Thank you for suggestions
Well, in this kata you don't need to use maps or sets of hands. I used
Ord
instance to emphasize that one need to compare handsHowever, I changed kata so now it doesn't requires writing an
Ord Hand
Read
andShow
instances were not included in initial solution, they was in preloaded module, but there are issues with preloading it in "Run tests" (see bug reports forum)I placed this code in initial code as workaround, I will change it as soon as problem with preloaded code will be fixed.
Thank you for pointing on cheating possibility with counter, I'll include several random tests
It seems that "Preloaded" module isn't loaded when user presses "Run tests" (at least, for Haskell). But it is loaded when user submits solution.
So I cannot, for example, define data types or some instances in this module
Also this problem isn't detected in kata validation process
I think that correct behavior is to load it in both cases. Please explain me design goals if I'm wrong. Also validation should run tests (the same way as when user presses "Run tests") with complete solution.
Is there any way to preload data types in test cases?
It seems that "Preloaded" module is not loaded when user presses "Run tests" button, it only loads when solution is submitted
Also this problem is not detected when one validates new kata
I get:
/tmp/haskell1141015-7-8nf0jc/TreeByLevels.hs:3:8:
Could not find module `TreeByLevels.TreeNode'
Use -v to see a list of the files searched for.
Also this issue is reported by @g964
I get "Unknown error" after approximately 4 sec, but my solution is correct and effective. In test environment I calculate
fib 2000000
andfib -2000000
with all other tests in 2.5 secHowever, I tried once more and it succeeded
Maybe this information will help in catching this bug