Ad
  • Custom User Avatar
  • Custom User Avatar

    fixed

  • Custom User Avatar

    fixed

  • Custom User Avatar

    Approved. Ta!

  • Custom User Avatar

    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.

  • Custom User Avatar

    JS fork that fixes several issues:

    • Updated to Node 18 (fixes this issue)
    • Fixed random tests (previously, random tests tested the same number over and over due to the misuse of the 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)
    • Shuffled random tests so appearance of tricky doubles were more randomized (previously random tests would test a block of tricky doubles followed by a block of actual random numbers) (fixes this issue)
    • increased number of random tests to 100
    • general cleanup of test code
  • Custom User Avatar
  • Custom User Avatar

    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).

  • Custom User Avatar

    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!

  • Custom User Avatar

    JS: Node v12 should be used along with the appropriate assertion tools (Mocha + Chai)

  • Custom User Avatar

    Approved :)

  • Custom User Avatar

    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 :)

  • Custom User Avatar

    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!

  • Custom User Avatar

    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.

  • Custom User Avatar

    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...