Ad
  • Custom User Avatar

    Closing since it seems to be resolved whereby the fork is approved

  • Custom User Avatar

    Approved by someone

  • Default User Avatar

    That's weird. Snail was trivial for me (less than 1 minute trivial). This I can't figure out.

  • Default User Avatar

    This is a fantastic kata. I saw it as an opportunity to brush up on recursion and data structures.

  • Default User Avatar

    I have forked my rejected Java translation and reworked it here: https://www.codewars.com/kumite/62b37def10340c442db4bd7c?sel=62bc8437044fff000ffb33b1.

    This seemingly straightforward challenge runs into inherent problems, because:

    • Binary can't precisely store some decimal values
    • Java data types generally cannot store irrational numbers without some loss of precision
    • Coders may complete the task with a novel order of operations that differs from those employed by the author. Inherent loss of precision may well lead to an equally valid result that differs from the author's.

    I have opted to modify the test assertions to accept any resulting running pace that falls within one second of my answer (a one-second margin of acceptability).

  • Default User Avatar

    Hmmm...these all are very advanced considerations (yikes! for a "basic" kata). I've experimented with Apache Commons Math 3.3 BigFraction as a silver bullet. That solution just seems to delay the inevitable challenge of converting an irrational number to one that conforms to the string output of the kata. There, too, an order of operations biases the result when converting the fraction to a Java primitive. Conversion of BigFraction to BigDecimal may yield java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.

    How about I leave the kata's method signature as is and accept a one-second tolerance in the result? Trade-offs abound here (existing difficulty rating, approved translations, and accepted solutions).

  • Custom User Avatar

    same kind of operations

    same order of operations

  • Custom User Avatar

    Your solution always passes because it uses the same kind of operations as the reference solution.
    The solution in the post above is mine. it uses another order of operations, and fails one of every a couple of runs, even though its correct. Unless you think its not, then I'd be interested why.
    If my solution is correct, it should pass every test run. if my solution is incorrect, it should fail every test run. With your translation, as with any other currently present, it usually passes, and sometimes fails. and there are more users who reported this problem.

  • Default User Avatar

    But that's not my Java solution to the kata. When I run my tests with csv input parameters "1.0,55:06,55:06", my solution passes. I've run 100s of thousands of random tests and believe it's always passing.

  • Custom User Avatar

    Rejecting because https://www.codewars.com/kata/578b8c0e84ac69a4d20004c8/discuss/javascript#62b49d378e12f8001794b14c
    However feel free to fork, apply some fixes (if you have any good idea), and republish when the issue is removed.

  • Custom User Avatar

    I am reluctant to approve any further translations to the kata as it seems to be fundamentally broken. Two existing translations have problems with floating point accurracy (see two issues below), and as far as I can read the code, the Java translation can face similar issues.
    I would love to have the general issue in the kata fixed (i.e. remove the floating point inaccuracies, either by changing distance to a precise data type, or by changing assertions to use fuzzy equality), but I'd approve the Java translation if it did just that. However, I am afraid that changing the input format would introduce considerable inconsistencies between translations. Maybe allowing for a one second tolerance of the answer would solve the problem?

  • Custom User Avatar

    [12] calculate_random_tests(double, String, String) [0.0, 67:55, 153722867280912930:07]

    Random tests generate 0 for travelled distance.

  • Custom User Avatar

    Regular users cannot approve their own translations.

    Content maintainers and mods are able to approve own forks, but it's meant as a way to introduce bug fixes quickly, and not to provide a new content. When a privileged user creates a totally new translation, it still should go through the regular review/approval process.

  • Default User Avatar

    Approving one's own translation should be avoided, right? Or is that the de facto standard (with an eye on speed to market)? Thanks.

  • Default User Avatar

    Greetings. I have solved many, many kata but never translated one. I humbly submit my first Java translation for consideration.

    Myself a runner, I perform this calculation almost daily with a basic calculator. I could not resist the temptation to solve it but found my language of choice was not an existing option.

    Inherently random tests require a solution so as to compute the expected outcome at run time. Is it typical for authors to provide an alternate solution for the random tests as a safety precaution (a built-in quality control)? That was my take and the route I chose.

    Thanks.

  • Loading more items...