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.
I think there is 1 such kata (can't find it).
is there a kata that has excellent random distribution checking?
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.
C
Description says "return an empty array if your array is empty", but tests require null to be returned.
This comment is hidden because it contains spoiler information about the solution
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
This comment is hidden because it contains spoiler information about the solution
Javascript:
Couple of conditions mentioned in the description are not checked in the test cases
This comment is hidden because it contains spoiler information about the solution
Fixed.
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 tounsigned
. And it is better to useuint64_t
fromstdint.h
to avoid confusion withunsigned long
andunsigned long long
. Also, the upper bound of inputs could be increased to2^64 - 1
.Fixed.
That's Haskell's function declaration syntax (maybe some other languages use it too), and it indeed should not be used for ASM katas.
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...