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.
The
check_list
test function always returnsTrue
if one of the arrays is empty.Hello! Try writing solutions for smaller arrays on paper (Note that there are many solutions). Some of them will help you find the pattern
It is, thanks!
Thank you, ammended the Kata. Can I credit you in the description?
Changed
Perfect solution!
Fixed
Fixed
I've fixed the test to check just for precision, not exact num/den pairs. You should be ablt to publish your solution now.
Calculating all possible ranges seems like an overdo comparing to the 110 iterations. I've changed the random tests to simple check of all possible precision, and it doesn't seem to cause any trouble with perfomance.
Ok, I can change the number of tests to 500 if you insist. But I thought that the purpose of random tests is to check whether the solutions works in general, rather than test all possible inputs. If I need to test all inputs I can just make a single
for
loop with every precision possible, that would be more explicit and cpu saving than generating random numbers.Also, I think that hardcoding every possible fraction shouldn't be considered as a solution, but I don't know how to handle this and make codewarriors to think about the algo. I can increase precision, but that'll just make them to generate some more hardcoded values. Some advices about how to avoid that would be appreciated.
Please, leave your feedback or thought about this issue and I'll go straight to fixing that.
Sorry, haven't noticed that. Now it's fixed :). Also reduced the number of random tests in half, since the choice interval is rather small and some random precisions duplicate themself.
Can you give some details about what's wrong? Maybe you can show an example. If the random tests are that bad I can remove them and add 20+ static tests, that's not a big deal.
I've searched for duplicates before writing theis Kata, and I've looks through all
Possible duplicates
that CW gave me. But if there is some duplicate that I've missed, please, send it to me.Then I will rewrite this kata to differ from the duplicate. :(
I've added Python translation. Can you check it?
It also have some improvements like constant check and all functions that can return pi easily are stripped away. If you have some questions or improvements feel free to ask me. :)
Loading more items...