Last active
June 10, 2023 23:10
-
-
Save xcombelle/444c816c5b19a911eb91b2f548543a9a 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
from itertools import product | |
dices=[range(1,7),range(1,7),range(1,7),range(1,7),range(1,7)] | |
wins={0:0,1:0,2:0} | |
C = 0 | |
for a,b,c,d,e in product(*dices): | |
n=0; | |
d,e =sorted([d,e]) | |
A,B = sorted([a,b,c],reverse=True)[:2] | |
if A>e: | |
n+=1 | |
if B>d: | |
n+=1 | |
wins[n]+=1 | |
C+=1 | |
print(C) | |
s = sum(wins.values()) | |
print(wins) | |
print(100*wins[0]/s,100*wins[1]/s,100*wins[2]/s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment