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.
Maybe they didnt even start yet. The process might take some time I believe.
It was pretty difficult to get it right, because of all the recursion that was going on my solution. I replaced it with a slightly slower solution that does not need exceptions at all. Try it now.
In the Python context, what exactly do you mean? Using Decimal? Using Fraction?
If two Decimals are quantized to the same precision and then compared, is that strict or approximate?
Of course - if you are running a bank. But it's overkill if you want people to see how the interest rate changes in different conditions. Making the user do exact calculations would reduce the number of people who would attempt the problem. Good programming practice is not necessarily good educational practice.
There should be no floats, no rounding of floats, and no formatting of floats. Monetary operations should be precise on every step and avoid imprecise representations. Monetary values should be precise, and interest rates should be precise, and final verification of correctness should be strict, and not approximate.
Fixed.
On further thought, I think the message returned by assert_approx_equals might be confusing because I haven't explained the margin. So I switched to assert_equals.
Agreed - I was just being over-protective. :-)
I still think it's worth keeping the rounding:
(1) Some people might mistakenly round too early (in the internal calculations rather than the final step), which might introduce inaccuracies.
(2) If I don't ask the user to round, I need to explain what margin of accuracy I'm using, and that might be distracting for this simple kata.
It was not actually a problem with the reference solution (since no reference solution is used) but I found and fixed a bug where randomly generated nodes were not guaranteed to be unique, which may have been the problem.
should be fixed, please reset trainer and verify.
.
done
Oh. Even though it isn't a DIRECT clone of those, I'll still take it down. Thanks
replaced with
your solution now passes; thanks for the coming up with concrete details
can you give an example of such a solution ?
Loading more items...