Last active
November 6, 2022 17:55
-
-
Save fabienhinault/bee188b6e9d3b823e82c0c989be13dc8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import random | |
ts = [list(reversed(sorted([random.randint(1,6) for x in range(n)]))) for n in [3,2]] | |
js = ["attaquant", "défenseur"] | |
for t, j in zip(ts, js): | |
print("tirage " + j + ": " + str(t)) | |
r = [a>d for a,d in zip(ts[0][0:2], ts[1])] | |
djs = [-sum(_ == v for _ in r) for v in [False, True]] | |
for dj, j in zip(djs, js): | |
print("domage " + j + ": " + str(dj)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment