Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Last active November 6, 2022 17:55
Show Gist options
  • Save fabienhinault/bee188b6e9d3b823e82c0c989be13dc8 to your computer and use it in GitHub Desktop.
Save fabienhinault/bee188b6e9d3b823e82c0c989be13dc8 to your computer and use it in GitHub Desktop.
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