Ad
  • Custom User Avatar

    I think for this kata to live up to "diabolical" it should require constant time solutions. Tests should include large very inputs, and expect very large outputs.

  • Custom User Avatar

    You need to specify the units for all relevant arguments. I am guessing that distance will be in meters and that velocity will be in meters/second, but people shouldn't need to assume that, it should be clear. (The time parameter is irrelevant, but the distance parameter is important, since you defined the width of the bird in cm)

  • Custom User Avatar

    Are you sure your algorithm is correct? When I use 10cm affinity, I get way more bounces than you, but when I use 1km affinity, I'm at most 1 bounce away from you.

  • Custom User Avatar

    Please also explain the parameters in the description, even if they are explained in the other kata.

  • Custom User Avatar

    Seriously?
    The description spins this grand tale about the fly flying back and forth between cars, so I spend time calculating and coding a solution for this, and then that part of the code is never tested. The fly is always 10x slower than any of the cars, it never completes a single trip, much less round-trip.
    Either increase the fly's speed so this has to be taken into account or delete that from the description.
    Sorry if I sound frustrated. I thought the problem posed a really cool idea. Turns out I could have stopped coding after the second line.

  • Custom User Avatar

    Don't round floats! Compute result with maximum precision and compare with test_approx_equals.

    https://docs.codewars.com/authoring/kata/floating-point/
    https://www.codewars.com/kata/5f9f43328a6bff002fa29eb8

  • Custom User Avatar

    It would be worth to specify whether orders of magnitudes are expressed in multiplies of 1000 or 1024.

    While it's clear that 1MiB = 1024KiB, having only KB, MB, etc. visible it's not clear if it means multiplier of 1000 or 1024.

  • Custom User Avatar

    One sample test makes no sense:

    test.assert_equals(readable_size(16492702728192), "15 TB, 27 MB")
    

    The expected result should be "15 TB and 27 MB".
    (or the expected outcome in case of exactly 2 items must be stated in the description, but it is bad style)

    P.S. It would be a good idea to add some examples and explanation in the description.

  • Custom User Avatar

    This is a terrible idea. You shouldn't rely on people to know arbitrary programming languages to solve the task.

  • Custom User Avatar

    In python the standard way to return multiple values is a tuple.

  • Custom User Avatar

    hi,

    • ordering in the output isn't explained
    • I got a failed test where my code found 2 solutions of length 4 while yours only found 1,so I suspect your codeha has some mistake in it.
    • don't ever use global vars
    • don't use map as argument name because it shadows the built-in

    As pointed below, the main problem here is that we already have a lot of this kind of problems, so it's effectively a duplicate.

    cheers!

  • Custom User Avatar

    There're already many pathfinding katas. Judging from the description, this one has nothing novel or interesting to offer.

  • Custom User Avatar

    The JS version expect Python:
    /workspace/node/test.js:5
    import codewars_test as test

  • Custom User Avatar

    Do not round floating point values.

    Ask for a result value and test it with a margin for error.

    This is extensively documented.