Poker Real Time Odds on Mac OS X: Part 5
The continuing story of creating a tool called SeeingStars, offering real time odds for PokerStars. Read from the beginning here.
Calculating odds can be time-consuming. A short-cut preflop is to use pre-calculated tables. I found a table of preflop odds for all starting hands here. I copied this into SeeingStars, and created some code to look up in this table your starting hand by # of players. It works well, and outputs as follows:
cards = hand: Jc 5s, playerCount: 2, board: : 47.1% chance of winning
But who wants to read tiny text while playing? I made a HUD-style window, found a scoreboard style typeface, and displayed the number in a large size:
Not looking too bad, I think.
However this is only working preflop. After the flop, turn and/or river are revealed, it is more complicated. A look-up approach would require more than 500 billion recalculated values. Two possible approaches are
- iterate through all opponent cards and all possible outcomes. This takes too long, so I won’t do this.
- to sample a range of possible outcomes via the Monte Carlo method.
I think with the Monte Carlo method the odds calculated by sampled values will soon approach the actual odds. The trick is determining the amount of possible outcomes to sample that balances time constraints and accuracy.