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.
Funny
Think my code was rather convoluted but still very fun to be able to complete this, love the oop metaprogramming katas.
clever!
python new test frameworks
Yes, I exploited lack of random tests
python new test framework is required.
It was fun to discover nega-binaries. But in the meantime, I realized that ternary (base 3) numbers offer negatives more naturally by using the digit
-1instead of2, so we have numbers..., ˧11, ˧˧, ˧0, ˧1, ˧, 0, 1, 1˧, 10, 11, 1˧˧, ....Also, for binaries we can simply add another terminator besides the zero end, which corresponds to infinite
1digits to the left, but it actually acts in all means as-1.Nice!
How was using negabinary for you?
Do you think it's better than just using signed magnitude would be, or is it over the top? It makes some things more complex, and others less, than in signed magnitude, but is it overall a good encoding, is it a good trade-off?
Python: Random tests are vulnerable to input modification
Python: see this
The description says:
But
a.uis an instance of the classUwhich does not have a copy constructor.This also implies that we should copy the attributes when
getattris called, but theit_5tests don't follow this, in particular with this test:If I actually copy the attributes, I fail this test.
(I would also like to bring attention to this unresolved issue from 4 years ago, which also caused me some frustration.)
OK, issues resolved, please republish now.
ETA: Yay! :D
Thank you very much.
Sorry, I lost focus and could have turned to this somewhat later only..
Loading more items...