Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Divide and conquer simulation solution in Creative category for Achilles and the Tortoise by OrginalS
def foo(a1_speed, t2_speed, a1, t2, i, mult):
while t2 >= a1:
t2 += t2_speed * mult
a1 += a1_speed * mult
i += mult
t2 -= t2_speed * mult
a1 -= a1_speed * mult
i -= mult
if mult >= 0.000000001:
return foo(a1_speed, t2_speed, a1, t2, i, mult/2)
return i
def chase(a1_speed, t2_speed, advantage):
return foo(a1_speed, t2_speed, 0, t2_speed * advantage, advantage, 1)
Oct. 31, 2019
Comments: