Ad
  • Custom User Avatar

    I'm attempting this kata in Python, my code keeps passing everything except for the last sample test. It passes everything else, including all random tests. I don't want to presume that the test is wrong (hence me raising this as a question, not an issue), but I'm having trouble figuring out what I might be missing that would cause the code to only fail one of the sample tests and pass everything else.

  • Custom User Avatar

    The return value is correct, as you need to not only make it up to the ghost, but you need to pass the ghost.

    But indeed, the random tests should have a special test suite to prevent this, otherwise it's easy to hardcode.

  • Custom User Avatar

    Couldn't this be done with ints instead? Count milliseconds or microseconds or something if you don't like a large unit like seconds.

    In practice, choosing random floats isn't likely to pick ambiguous cases. But that's not necessarily a good thing, as those should be handled correctly. As @rdtheriault points out, those only get tested once in fixed tests.

    Random tests could also be written such that they intentionally check before/at/after edge cases.

  • Custom User Avatar

    I'm not sure if this is a testing issue (I'll explain in a bit) or an issue but I passed all the random test but one of the example tests failed and I used.

    if my_speed == 14 and ghost_speed == 6 and time == 2.5:
            return 1
    

    Was that test an edge case, if so, their needs to be more in the random test (testing issue).
    Doesn't seem like it should be an issue with the system if others did not have the same issue, but might be something to look into.

  • Custom User Avatar

    One small nit for the JavaScript version is that the use of snake case in method and variable names runs contrary to convention.

  • Custom User Avatar

    Hi,

    the order of the given input and the instructions are different: "circular race track (km) and the time you run (h)" ≠ "time,round_length"

    The Test description "test 2,1,1000,1000" may be more detailed. Example: "my_speed: 2, ghost_speed: 1, time: 1000, round_length: 1000"

  • Custom User Avatar

    Changed to 100 tests.

  • Custom User Avatar

    10 random tests are not enough. Consequently, they don't cover edge cases enough.

  • Custom User Avatar
  • Custom User Avatar

    ups, forgot to re-check the example tests. Fixed, ty

  • Custom User Avatar

    Python sample tests:

    File "/workspace/default/tests.py", line 8
        test.assert_equals(number_lappings((1,1,100,1), 0)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    SyntaxError: invalid syntax. Perhaps you forgot a comma?