Ad
  • Custom User Avatar

    because of this code i now understand what this codes do unlike from the first one it is readable for beginners like me

  • Custom User Avatar
  • Default User Avatar
  • Custom User Avatar

    and random tests working now.

  • Custom User Avatar

    Because at the time i wrote the code i was 6th kyu and then 5th kyu katas were worth more to me
    Now being 4th they are not worth much to me ...
    i don't really care - happy that i was not crazy or stupid and was missing something trivial

  • Default User Avatar

    2% instead of original 15% or so...

    why that?

  • Custom User Avatar

    It runs now. I am glad my code was good but by now the solution is worth measly 2% instead of original 15% or so...

  • Default User Avatar

    ** ABOUT JavaScript **

    I am very very sorry but I had a typo in the code of one function in the tests... I fixed that and I hope that now everything will go well for your JS code. Please could you tell me if it works now?
    Forget what I wrote about JS, I am the culprit, sorry again. I consider the issue as resolved but if it is not post a new issue.
    Thanks for your help, cheers!

  • Default User Avatar

    I am very very sorry but I had a typo in the code of one function in the tests... I fixed that and your code goes right now! Could you try again and tell me if it is right. Thanks for your help.

  • Custom User Avatar

    The tests never return "NaN" so I don't understand how you got "Expected Nan".

    Neither do i. Could you try running my code as if it's another of your solutions and see if it passes?

    Thank you for your advise to avoind arrays. i will see about that. But since in all tests my function returns the right result and the tests say expected NaN, that can't have anything to do with my code, can it? If my code got overflow it would not return right results time after time...

    PS.

    var array = Array(n+1).fill(1);

    I can hardly imagine this line produce an error. this is is basic at it gets.

    Here is a screen shot: http://tinypic.com/m/jhc0at/3

  • Default User Avatar

    ** ABOUT JavaScript **
    I can't understand how you got 300092 as expected with the random tests.
    Calling "reference" solution the function "perimeterSol" in the random tests
    and "initial" solution "my" function "perimeter" - used to give the results in the fixed tests -
    these "iniial" and "reference" solutions are exactly the same as you could guess.
    In principle they can't give different results.
    Moreover my JS solution is not very different of Ruby, Python, etc... ones.

    I tested lots of time the reference solution with n = 20 and I always get the correct result 114624.

    I believe the only 63 persons who passed this kata, did it when tests were good;
    63 persons over 1647 is a bit small for popular Javascript, isn't it?

    The tests of this kata were never changed. You can't say they were good and now they are bad.
    They are the same. Moreover if I had changed the tests the solutions which passed the kata would
    not pass anymore and you would see lots of invalidated solutions but there are none.
    63 is not a lot I agree but it is not nothing and only one guy cheated to pass.
    Furthermore maybe this kata has not the style of Javascripters?

    I refer to the guys who passed the kata because, as you could see if you want, the solutions they use
    are very different but pass the tests. There are memoization, no memoization, many calculate
    the sum of the fibs, others (I am part of others) don't calculate the sum using a property of the
    fibonacci sequence.
    Since you passed the kata you can see the random tests, you could also edit the kata as 10XL said or
    directly edit it. I will consider your issue if you tell me exactly where the problem is.
    I am sorry of these problems and I would like to know where they are.

    ** ABOUT Java **
    Until now I thought a kata author is free to use Big Integers if he wants to. I think it is a good
    experience for every one even if it is not completely necessary. I personally regret that
    some languages don't have Big Integers. BTW it is not my responsibility if Java has an "ugly"
    way for Big Integers.

    If there is a problem, I hope you will find it (and I will be very happy). Then please tell me.
    Thanks for reading this long post.

  • Custom User Avatar

    not necessarily fix the tests but you can fork the translation to see the tests. from there, you could potentially fix errors in your fork and get it approved once you've published your version.
    click the link in my previous post, the JS translation is at the bottom of that page. adding '/translations' to the end of a kata url will take you to this page for all katas.

  • Custom User Avatar

    Excuse me, what do you mean?
    I did use kumite before, but I don't really know how to use them here.
    You mean I can fix the tests?

  • Custom User Avatar

    if you've completed a kata, you should be able to see the translation kumites at '/translations'.

  • Custom User Avatar

    So g964.

    ** ABOUT JavaScript **

    5 other users have told you that the random tests in Javascript are wrong and you dismissed them with "other people have passed the kata".
    It just happens that I have passed the kata in other languages (Python and Java) and I have cross-checked the results.

    To prove you the inconsistency of your random tests, I leave you this screenshot:

    http://oi68.tinypic.com/8zjus4.jpg

    Do you see what's going on here? test case on the right for 20 (that you wrote) expects correctly 114624, but your random test on the left incorrectly expects 300092.

    I believe the only 63 persons who passed this kata, did it when tests were good; 63 persons over 1647 is a bit small for popular Javascript, isn't it?

    ** ABOUT Java **

    IMHO the use of BigInteger object instead of integer primitive type is completely unnecessary for the sake of the kata, let alone using numbers up to 22 digits!

    Basically the Java author forced the user to use ugly object operations instead of standard math, therefore a simple:

    return res*4

    have become an ugly:

    return res.multiply(new BigInteger("4"));

  • Loading more items...