Ad
  • Custom User Avatar

    I think there is 1 such kata (can't find it).

  • Custom User Avatar

    is there a kata that has excellent random distribution checking?

  • Custom User Avatar

    C#

    There's a problem with the tests checking even distribution - my passed solution is definitely not providing an even distribution...

    Having had a look at the relavent test in the Sample Tests, I think its a simple integer division issue:

    This checks for the distribution on '1's:
    Assert.Less(Math.Abs(Integers.GetValueOrDefault(1, 0) / Length) - (1 / 3.0), Threshold);

    However the number of 1s held in Integers.GetValueOrDefault(1, 0) is not being cast to double. Therefore when its divided by the total number of digits held in the integer Length, it comes out to 0. And since the Asserts are only failing when they find a proportion greater than 1 / 3 (which would be fine if the first calculation was correct), its passing everything.

    Casting Integers.GetValueOrDefault to double in each Assert should fix it I think.

  • Custom User Avatar

    C

    Description says "return an empty array if your array is empty", but tests require null to be returned.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    Very valid point; thanks for your feedback. I have updated the tests to generate dates much closer to the 'present', your solution has been invalidated ;-)

    let me know if there are further problems

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Javascript:

    Couple of conditions mentioned in the description are not checked in the test cases

    1. no test checks for a 0 length string - description says should throw an error
    2. no test checks for an illegal character at the mid point in a string with an odd number of characters - description strongly implies this should throw an error
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Fixed.

  • Custom User Avatar

    I suggest to change all types to uint64_t. First of all, negative numbers are not tested so it makes sense to change all types to unsigned. And it is better to use uint64_t from stdint.h to avoid confusion with unsigned long and unsigned long long. Also, the upper bound of inputs could be increased to 2^64 - 1.

  • Custom User Avatar

    Fixed.

  • Custom User Avatar

    That's Haskell's function declaration syntax (maybe some other languages use it too), and it indeed should not be used for ASM katas.

  • Custom User Avatar

    Revealing my own ignorance here, but I'm not familiar with the way the function signature was described in the Details:
    mod :: long a -> long n -> long

    Not exactly difficult to puzzle it out :) But it did make it a little confusing, and perhaps is an unneccasery extra barrier for anyone else who doesn't know the notation, and might be trying this kata is their first experiment with assembley.

  • Loading more items...