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.
Adding some more sample tests, and one that checks for correct pixel matching.
lmao broke syntax highlighting
This kata is so simple that it's a bit of a struggle coming up with a different solution lol
Anyways, reference solution added to the tests in an edit. I'm gonna leave the generator as-is instead of relaxing the checks.
Sorry about that, seems like I got into the habit of making write-only code.
I've added a few more comments and re-wrote parts of the generator so that it should be clearer how it works. TLDR: it remembers up to the last two numbers generated, so that it wont generate the same number or any intervals that can be merged. The test generator runs fine up to
withMaxSuccesses 12_000_000
on my end, so I'm fairly confident it works.There could probably be a harder version of this kata with higher iterations using a solution in O(log(iterations)) time
Done
why not?
Random tests added, description merged from C# translation
Good lord, just how many workarounds are there in Python? >.>
The only catch-all I could think of is to pass in something that cannot be passed into
eval
, but there are a few solutions that useint
to convert from string that would break.Hmm... yeah those tests were probably over-stepping it a bit, they're disabled now.
If you're referring to this kata, then this differs in that the goal here is to create a function like
map(x * 2, range(10))
instead of evaluating strings. As for disablingeval
andexec
, I think this would create a pretty large difficulty gap between proper implementations and those that just chuck it all into a string and pass it toeval
. My original idea was to have this kata generalize to types that do not implement__str__
/__repr__
.get_combinations
is spelled wrong in Python setup code.Done
Whoops totally forgot to disable
eval
herePython sample tests are still using
isGroup
instead ofis_group
Loading more items...