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.
Dear author, you can republish this one now considered the fact that there's random tests and more active beta stage nowadays!
You can check out several of the higher quality kata that you have already completed in Python and study how they handle producing random tests.
How do I generate truely random tests? If the seed can't change every run through it will always be possible to just make an array of the answers and bypass the problem. An idea I had was to tie the random seed to some attribute of the user's code, like number of characters or something. Alternately a pointer to the top of the stack might work but that's not possible in Python I don't think.
No random tests. I suggest you unpublish immediately and add them. There is documentation to help.
Should I change the name to something more descriptive?
You're comparing the user's solution return value with itself.
Yes, using a reference solution:
https://docs.codewars.com/authoring/guidelines/submission-tests/#reference-solution
https://docs.codewars.com/languages/python/authoring#example-test-suite
I wrote a random input generator but am unsure how to test. In other examples I saw, the result has some property that can be tested against. Like testing an absolute value function would have a random input and the test would be whether the result is greater than zero. But with this problem I don't know of any property this can be tested against without linear algebra which isn't supported with codewars libraries. The only thing I can think would be to test the user solution against a known functioning one. Is there a way to do that?
https://docs.codewars.com/authoring/guidelines/submission-tests/#random-tests
What is a random test?
The number of lights is already encoded in the list length, so there's no point in passing it in another argument.
Or maybe the number of switches can be different from the number of lights, but then this case should be tested.It doesn't looks like that ("only describes what OTHER lights").Random tests should be added.