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.
dices is not a word
These issues [1][2] pointed out that for n = k = 0, the result should be 1.
However, this did not mean that the result should always be 1 if k = 0, just for the specific case of n = k = 0.
It is impossible to roll a 0 with a six sided die.
outcome(1,6,0)
must be 0.there is always exactly 1 case to reach k = 0 regardless of the number of dice you have
needs to be removed from the descriptionact(1, 6, 0, 1), act(2, 6, 0, 1), ...
need to be removed from the testsThis comment is hidden because it contains spoiler information about the solution
python new test framework is required. updated in this fork
The anti-cheat is an absolute garbage. You can:
my_all
andmy_any
just once outside your function to pass the "use ofmy
functions test"There're a lot more exploits available like:
reduce
count
[*]
(Python 3.6)And on top of that, all this stuff is preloaded, so the kata cannot be completed after the CW runner update.
Based on all these problems, the fact that the author is not active anymore, the fact that the satisfaction rating will never climb high enough to make this kata approvable (and the fact that the whole kata premise is "solve a very basic task in a very stupid and inefficient way"), I removed the 2 final tests checking for
my_any
andmy_all
function calls so it at least can be completed, in case anybody will ever stumble upon this trash and tries to solve it (other "anticheats" are still in place, though).In the middle of the tests suddenly you've changed the max distance to
100
, which is completely unexpected and out of specs.Actually providing a kata based on generator is a good idea but as you group primes, you should definitely allow
zip
anditertools.zip_longest
type and not only pure generators.Since Python 3,
zip
produces also a generator and grouping the way you want is its own purpose.There are tons of prime number katas, but there is a twist (not much, though), so it should probably not be considered as a duplicate.
However, there is something wrong - probably with the test cases -, because my attempts time out, even though I pre-generate my list of primes up to 10^7 in about 400ms, and only read from this list thereafter.
Furthermore, the description should mention that large numbers (up to ???) will be tested, so you need to write an efficient algorithm. This will also affect the ranking of the kata, because it requires more maths and/or coding knowledge, than a simple one where primes are tested up to let's say 1000.
Oh, and don't forget to add random tests.
Cheers