Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Kinda defeats the purpose of doing the kata, doesn't it?

  • Default User Avatar

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

  • Custom User Avatar

    This answer does not even consider trailing spaces. We need better test cases.

  • Custom User Avatar

    This is wrong; the spec clearly says not to use the built in functions.

  • Default User Avatar

    Hi Kursulia. Thanks for your reply! Interesting to read your solution because I did not know about Fisher-Yates. Nice solution. Personally I think that maybe unit tests are stronger when it does exclude the random factor. My Bingo Number Caller kata is a good example. There I use dependency injection to pass the Random object. That makes it possible to pass a stub instead of the Random object.

  • Default User Avatar

    Hi, FrankK! Thanx a lot for you attention to my solution. U R right, but I was wondered when I have recieved your comment and Ive tried to submit this solution again. As you already know the EachNumberOnCardIsUnique() test was failed for 34 times (but the 35-th wasnt,LOL). When I tested my solution for the first time, I saw the green-colored frame and just clicked "Final Submit" without any attention to tests. (I really pretty lucky person!)
    So random in .NET isn't random enough, you know and it can`t solve the unique numbers problem. But the shuffle can! (The Fisher–Yates algorithm). So link to my new solution: http://www.codewars.com/kata/reviews/566d5e980bdf235503000023/groups/57558befbe106bc9820006e7

  • Default User Avatar

    Hi Kursulia,

    Thanks, you showed me some language features in VS2015 I did not know of yet!

    Your code is very short and that draw my attention, but when I had a closer look I could also see why: your solution is incorrect because the numbers on your card are not unique. I wonder though how you have been able to submit because the unit tests should have told you.

    I did some testing on your solution and, as expected, the EachNumberOnCardIsUnique() test fails. Just as the RandomnessTest().

    Can you tell me more about it?