• Question and tests do not match

Question related to mission Achilles and the Tortoise


http://www.checkio.org/mission/achilles-tortoise/ and http://www.checkio.org/mission/achilles-tortoise/solve/ specify the output as: The time when A1 catch up T2 (count from T2 start) as an integer or float.

The first assert is

assert almost_equal(chase(6, 3, 2), 4, 8), "example"

If 4 was the time in seconds, Achilles would have run 6m/s * 4s = 24m and the tortoise would have run (including the advantage) 2m + 3m/s * 4s = 14m. In fact, Achilles and the tortoise meet after 2/3s: 6m/s * 2/3s = 4m, 2m + 3m/s * 2/3s = 4m. So the self-checking code seems to assert the distance, not the time.

A check with the second assert confirms this:

assert almost_equal(chase(10, 1, 10), 11.111111111, 8), "long number"

After 11.111111111s Achilles would have run 10m/s * 11.111111111s = 111.11111111m and the tortoise would have run (including the advantage) 10m + 1m/s * 11.111111111s = 21.111111111m. The self-checking code asserts the distance which Achilles met the tortoise after 10/9s: 10m/s * 10/9s = 100/9m, 10m + 1m/s * 10/9s = 100/9m, distance is 100/9m = 11.11111111m

I wrote my code as if the output should have been the distance that Achilles has to run to catch up to the tortoise and this code was accepted. (http://www.checkio.org/mission/achilles-tortoise/publications/siebenschlaefer/python-3/random-fact-one-in-every-four-americans-has-appeared-on-tv/#)

To correct the problem you could either specify the output as "The distance A1 has to run to catch up to T2." or change the asserts.

Other than that, I appreciate the effort you put into these problems. Thank you for this and the other problems.