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
I'm trying to accomplish this kata in its crystal version, but the test gives me the error Vector undefined.
I guess it should be rewritten using Array.
I think I don't quite understand how exclusive disjuncion should work, in the tests I get:
Testing for [false, false, true, true] and true
Expected: true
got: false
I thought I should do:
(false ⊻ false) ⊻ true) ⊻ true)
that is:
( false ) ⊻ true) ⊻ true)
( true ) ⊻ true) = false
I guess I must have misinterpreted the explanation, can anybody explain it to me?
Hi guys, need a little help here, I'm caching the result but even with that still getting timeout, any hint???
Ok, I added random tests (only in the Crystal version, so far, if anybody is willing to port it to js go ahead).
I there some way to display the randomly generated json when a test fails? that way whoever is trying to solve the problem can have a failing test case to keep working.
you're right, sorry
Very nice kata, you could add to the details that any other letter should just be ignored
This comment is hidden because it contains spoiler information about the solution
I'm about to try this kata, but just looking at the examples the folowing questions arise, that might be answered with simple examples, like this:
can number be "234"? (ie start with a number greater than 1)
can number be "134"? (ie skip digits)
can number be "1223"? (ie repeat numbers)
I guess, specially after reading this discussion, that the answer is yes to all of them, but adding these simple examples would make it more explicit. It's very frustrating when you fail a test not because you couldn't code it properly but because you didn't understood the problem.
Thanks for the explanation, if I understood correctly I should also include my own working solution and execute it with the randomly generated json, that would be my "expected" result. Am I right? The only thing that doesn't convince me about random tests is that the same solution might pass or fail the test depending on a random generated case.
I didn't know about random tests. Couldn't be the case that some test might fail or pass depending on the random values? Wouldn't like that scenerio. Do you have any example of random test?
You're right, fixed. Now I sort the results on the test, any order should be ok.
I guess I assumed that a function called deepCompare should be able to correctly compare anything, but anyway, to be more specific I added it to the kata's description. Thanks!
you are right, thanks.
the first bug is easy to fix, but the second is not that trivial. you solution is quite clever, I guess another solution would be to have a list of all meaningful regexp chars and escape them with ''
thanks!
BTW, and a little bit out of topic, I never understood the purpose of random generated data for unit tests. I mean, the idea of unit tests it's to be predictable, what good is a unit tests that 'sometimes' might fail? Just asking out of curiosity
Loading more items...