DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Fun idea for a coding challenge: Texas Hold'Em Poker Hand Analyzer  (Read 6,355 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
For anyone interested in a fun coding and math/probability challenge, I thought of one the other day.  And with the Programming School area offline, I'll just post it here.

Texas Hold'Em Poker Hand Analyzer

Allow a user to provide the hands for any number of players, and some (optional) shared hand cards.

The program should then calculate the odds of each hand winning (note there are cases where there could be a tie) a game of Texas Hold'Em Poker.



Bonus points for making it easy to adjust hands/common cards.

Bonus points if your program can let you specify certain players cards as unknown.  For example it would be nice to say player 1 has "Ace and four of hearts" and there is one other player with 2 unknown cards.  What are my odds of winning?



This is exactly the kind of program they use on poker shows to show the likelyhood of each player winning as they play.  It's a great way to learn about probabilities.
« Last Edit: September 16, 2016, 12:46 AM by mouser »

Original address: https://www.donationcoder.com/forum/index.php?topic=43013.0