Skip to content

Instantly share code, notes, and snippets.

@petrosDemetrakopoulos
Created September 24, 2022 11:01
Show Gist options
  • Save petrosDemetrakopoulos/8040b5aab076cafe05b1d8e098214eb7 to your computer and use it in GitHub Desktop.
Save petrosDemetrakopoulos/8040b5aab076cafe05b1d8e098214eb7 to your computer and use it in GitHub Desktop.
Texas Holdem Monte Carlo
def monte_carlo(hand, table, players=2, samples=10000):
dist = [0,0,0]
for i in range(samples):
outcome = simulate(hand, table, players)
dist[outcome] += 1
return list(map(lambda x: x/samples, dist))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment