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.
54 bytes
why this kata is 7 kyu it's should be 8
Clever, but this code is less readable than if you split it into several functions with explicit names.
same. Even following along with the "video" the author describes, my solution passes around 30 per run.
the kata description already mentions this detail
I think the instruction is missing a rule for method beging 0 and the distance to the nearest number is equal in both directions.
It seems to be, that in that case, the smaller of both numbers should be chosen.
3 lines tho? :D :D quits
Approved. Thank you!
In my, highly personal, opinion, readability is actually better served by repeating
test.assert_equals
, and maintainability of simple code is better, even if you would have to patch the tests umpteen times to change something - but it's probably always the same change.I prefer not having to read complicated code in some other place to fully interpret tests. And I have no limitless trust in authors not to introduce bugs in that code.
This might be worth discussing on Discord.
Haskell translation
this translation modifies the description
Thanks!
Pretty funny and quite simple kata to exercise with, well done.
javascript translation with attempt at making the description a bit more language agnostic
.
Loading more items...