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.
python new test framework
Quite funny and mathematical kata.
assertEquals
usesBigDecimal.equals
, which requires the precision to the same too, which can be problematic.But even then, a custom message should be provided instead of this.
Reference solution violates this constraint in even the simplest case:
Random tests are setting 1 test block per random test and creates many duplicate methods per random test case. Why not just use a for loop?
Some tests are supplying prices with incorrect scale and sort of expect solutions to fix them, such as:
There is a conceptual problem with the kata: the kata asks us to find the outline, which is defined as
And the reference solution assumes that the outline is a triangle, and calculates the two sides accordingly. However, the two sides of the triangle are not straight lines: they are triangle sides displaced vertically by card width. The actual outline is hence all the card width and card thickness combined, not a straight line from the apex to the two corners. This is very obvious once card thickness becomes comparable to card length.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
why did you republish it, then?
Comparing what floats? Round what?
Is used where?
It's not clear what exactly should be within what bounds. There are various values that can be used to solve the problem. Should distances and internal angles be within 1e-6? Should something else? Mathematically, there are solutions that don't calculate those. Either there should be an exact definition of what is considered a regular polygon or there should't be tests with almost regular polygons that are considered not regular. (Note that you compare only adjacent values in your solution rather than all values.)
Hi,
In the tests floats are rounded to 6 decimals, and tested with a delta of [-0.000001..+0.000001].
I woill add a comment to the description.
thanks
What precision is expected? The sides of
[{0, 10.392305}, {6, 0}, {-6, 0}]
are[144.00000321302502, 144, 144.00000321302502]
.The tests in the python 3.6 version ignore the offset. (Sample test work fine, the actual tests need fixed)
you're right, I'll add some more tests
and rewrite my solution
thanks
Loading more items...