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.
I am glad you like the kata. :)
I collected several test maps that your solution does not agree with the test code. I used a more brute force (but slow) algrithm to calculate those maps again, which gave same answers to the test code. I guess the answers from the test code are more likely to be correct. When writing the brute force code, I found a way to improve test code speed. I updated the test code, but not adding any fix tests. Do you think I should add some 90 territory maps in the fix tests?
This comment is hidden because it contains spoiler information about the solution
Not a bad idea.
How about to change it this way: Instead of true and false, the code should return how many conflicting cells. If zero, it means the net is valid. A line of 8 cubes
[1,2,3,4,5,6,7,8]
has 4 conflicting cells; while a T shape[1,2,3,10,18,26,34,42]
has two. For those net not in one piece, return -1.These won't need big changes in the test code.
Thank you for the reply. I finished the 1kyu kata, with a messy spaghetti code. That was the 1k I spent longest time to solve. really appreciate the great kata. thx
No, I am not worried about it. 8)
I mean if we change restrictions in test code here, losing some score can be a concern for the existing solution authors. I do not see other impacts.
I won't lose any score if my old solution becomes invalid due to a new test code update, I think.
This comment is hidden because it contains spoiler information about the solution
I put a part of solution into the Test function in C. C should not have that concern above now.
I agree with you that there is no good way to limit hardcoded solutions.
However, I am not convinced yet the suggestion need be removed since test code can't police it. It implies the direction of solving, without missing the right experience. It likes a Klotski board game says you can only make 2D moves.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Done. Thank you.
Not good at C/C++. Please advise if anything else need modification. THX.
This comment is hidden because it contains spoiler information about the solution
Thank you so much for the suggestions.
I modified C and C++ test codes.
I modified it as you suggested. Thank you!
Loading more items...