Created
September 27, 2024 06:58
-
-
Save mrcrilly/357580b10c28c91b11a77bfa3d1a4606 to your computer and use it in GitHub Desktop.
main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat main.py | |
def captured(wolf_distance, wolf_speed, ct, cs): | |
wt = wolf_distance/wolf_speed | |
ct = ct/cs | |
if wt < ct: | |
return 1 | |
return 0 | |
def main(): | |
wolf_distance = 100 | |
wolf_speed = 10 | |
distances = [25,35,40,42,46] | |
speeds = [2,3,4, 6, 7] | |
child_num = len(distances) | |
c = 0 | |
for i in distances: | |
for j in speeds: | |
x = captured(wolf_distance, wolf_speed, i, j) | |
print(f"\tDistance:{i}, Speed: {j}, Captured: {x}") | |
c += x | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment