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.
Best solution!
it's good but why wouldn't you just leave some space to make more confortable :)
People often misuse "Best Practise" button. I would rather mark my solution as "Clever" if so.
It is definitely not the best practice. Variable names have to be meaningful and spaces should be used for readability.
This is true, golfed code isn't usually considered easy to read.
Does the job, but it's difficult to read.
indeed it is....smart hack
this is rad
ok
Errr .. no. You were still using
assertEquals
.Fixed !
Fixed !
If you want to tell solver their inputs,
Test.it
( or justit
) is a much cleaner way thenconsole.log
.But for debugging, solver can just print inputs, and when a test fails,
assertEquals
will already tell you theactual
andexpected
values.So there may not be much added value in printing them for every test.
Please don't round ( or truncate ) floating point values. ( If you want the whole story, I could reproduce it, but it's been commented on other kata quite a few times already. )
The much better solution is to compare with a margin for error, either absolute or relative. For relative comparisons, CodeWars has thoughtfully provided
Test.assertApproxEquals
.That pretty much pulls out the rug from under your kata, because the division thing is not really worth it. Sorry. ( Really. )
There must be something more interesting to do with L/D; aerodynamics is quite the subject. :]
Very similar effectively, ok i will unpublished it !
Loading more items...