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.
According to condition (1), this is the desired behavior. I added a sentence to (2) to make this clearer:
"NOTE: When the array is both not square and the wrong size, (1) applies, so "Array not square" should be returned."
Great, now it works :) I made some final adjustments to the description and naming, but now it is approved and published.
Hm, not really. Try to add a
print(matches(*i))
in the end of the random tests and you'll see that all tests still evaluate toFalse
. Like this:Read my last post carefully and see if you can make 50% of the random tests evaluate to
True
.The way I do it is to randomize test data until I get variables that makes the
match()
function returntrue
, the next return value must befalse
, thentrue
and so on. If you randomize a wildcard mask that looks like this00000000.00001111.11111111.11111111
the likelyhood if getting variables that returntrue
is much greater.Have a look at my tests
Test(match, random) { }
under the C Kata Reference.I'm a bit unsure if it should be translated into Python, but I have approved it. It sure is slightly harder in C though.
I'm not sure about C but this is not a 6kyu kata in Python.
I think your first line . . .
. . . only creates a reference to
arr
, then all changes onarr2
will be reflected onarr
too.arr2 = arr[:]
would be more efficient to your purpose.; )