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.
Python Translation
fixed
fixed
Approved. Ta!
In JS: I wasn't able to replicate this, but there are several problems with the random tests currently. The tests generate a block of guaranteed "tricky doubles" and a block of random numbers, and then tests each block. However, the random tests incorrectly use global variables and it causes each block of tests to use only one number, so each block tests the same number over and over. Also, in the random block, the "expected" value is always double the random number, even if the random number is a tricky double, which can cause tests to fail incorrectly. My fork fixes all these issues, just waiting on review and approval.
JS fork that fixes several issues:
var
keyword, original tests also would sometimes generate a tricky double and set the expected solution to be double the generated number instead of returning the tricky double) (fixes this issue)JS (at least): random tests are not random: https://www.codewars.com/kata/reviews/5697279e359c07b27600004c/groups/680421b9ceb8289cefa573f3
To check this, it would be very helpful to know which language you attempted, and what was your code (posted with code formatting, in a post marked as spoiler).
Hi, I believe there's a mistake in the test cases for this kata. According to the kata description, if the number is a "tricky double" (i.e., it consists of two identical halves like 8787 or 100100), we should return the number as-is. Otherwise, we should return double its value.
However, my function returned 15 when I passed 15 — and it passed the tests — even though 15 is not a tricky double and should have returned 30.
It seems like the current tests only check if the number has an even number of digits, but not whether both halves are equal.
Please review the test cases to make sure they follow the logic described in the kata.
Thanks!
JS: Node v12 should be used along with the appropriate assertion tools (Mocha + Chai)
Approved :)
Ooo... I bet I know what you need to do. Try forking the translation and see if it will let you do the merge in the fork. I'll still get the credit for the translation :)
Still getting the same message :(
But on the plus side, I was able to change the tests based on your comment - to put the "it" inside of the loop to give more details.
Thanks for that feedback!
Let me see if I can merge the changes... or find out what we need to do :)
I unpublished the translation, merged the descriptions, then republished. See if that does the trick.
That is great! Thanks so much for the feedback and the contributions!
I merged/approved the Ruby version, but when I then went to approve the coffeescript version it gives me this error:
"Description cannot be approved, recent changes from related record must be merged first."
Have you seen this or know what I need to do?
Loading more items...