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.
This comment is hidden because it contains spoiler information about the solution
You cast the result to string anyway, isn't using modulo (6 times) more expensive in this case?
If they even reach your code...
This comment is hidden because it contains spoiler information about the solution
Another problem with not returning
this
arises, when you try to check whether your created object is an instance ofNameMe
or not.:)
This comment is hidden because it contains spoiler information about the solution
Changed the code template, now is properly bug fixing for every language; thanks for the feed :)
Thank you rbeer for your alternative Python translation. However, I am not positive that your working solution passes all tests as when a number is passed in as a string, your program does not handle it properly according to the established Python test cases.
May you please fix the code for the working solution so it passes all random tests every time? Once the problem is fixed I will use your Python translation as it more accurately reflects the original intent of this Kata.
Cheers,
Donald
Sidenote: Next time if you want to publish a Kata translation, you may want to click on the "plus" sign on the language selection bar and do it the official way - this way, you will gain honor every time a Kata translation is approved ;)
My pleasure; for everything you might deem me useful with, feel free to contact me on our gitter channel or, if you wish, I can give you my private email :)
This comment is hidden because it contains spoiler information about the solution
Thanks for the feedback ecolban, I forgot to consider division by zero when making this Kata but for simplicity I think we may assume that both
a
andb
are non-zero provided both of them are valid numbers.I will make sure to consider corner cases in my future Katas :)
Thanks a lot GiacomoSorbi, I will utilize them in my future Katas.
Description updated. Objective should now be clear in every approved language.
Issue resolved.
Hello rbeer,
That is true; only the Javascript version of this Kata is bug fixing, in both Python and Ruby you pretty much have to code it from scratch because they are approved translations created by other users who have contributed to this Kata.
However, instead of changing the exercise itself (Python/Ruby version) maybe I will simply edit the description to make it clearer what is expected in each language.
Thank you for your feedback.
Cheers,
donaldsebleung
Oh, I am just a mere amateur with a lot of persistence and really a lot more still to learn, trust me that I am not that big, particularly compared to other top rankers which I deeply respect ^^'.
Anyway, both
Test.describe
andTest.it
work in the same way, meaning they group tests (which in itself is quite useful, so you can try and possibly miss a few of them in a single click instead of stopping execution at the first error - i.e.: you get something like "12 tests passed, 3 errors").describe
is usually the "father", having under him 1 or more.it
. Their syntax is quite simple, like:Test.describe(*message*, testFunction)
.In plain JS syntax, you would write something like:
Loading more items...