PDA

View Full Version : Need a Poker Odds Calculator for My Site


UrBluffingme
03-12-2007, 01:44 PM
Hey Guys,
I have a few questions regarding writing the code for a Poker Odds Calculator in Actionscript. I know a lot of people take slack for coming in here with questions like, "How do I write the code for....." If you think this falls in that category, ignore me. I can take a hint. ;)

I want a standard interface where a user can choose how many players are involved in the hand, what their cards are, and the ability to calculate odds for preflop, then for a specific flop, turn and river. First, is it even a viable option for a novice programmer with limited experience (but a solid fundamental understanding) of PHP and Actionscript to undertake this type of project?

Second, where do I start?

Last, are there programmers here who would be able to do this and if so, can you PM me to discuss?

Sorry, for the total newb question that I know completely sounds like "homework." But I swear it's not.

phoenixshade
03-12-2007, 08:22 PM
Well, it's not completely unreasonable from a programming standpoint, but you'd better also understand the complexities of probablility, and be ready to deal with a lot of factorals and powers. I assume by "odds" you mean odds of winning the hand... not just odds of getting a specific hand (which is far easier... fewer variables). This can get very complicated in terms of reducing it to an algorithm, especially when you have like four or six players in the hand. Gets even worse if you want to include more than one type of game.

I believe you that it's not homework. No programming instructor would by so diabolical as to assign something this mathematically complex...

If you don't know the math, I'm sure there are places on the internet where you can find it broken down. I could do it, but it would literally take me all day (or maybe two) to turn it into a general algorithm that a program could be based on.

Best of luck. Just wanted to let you know what you're in for. Beware of people with misconceptions that this is an easy task.

rodericj
03-19-2007, 01:44 PM
I'm also looking for a similar solution. I've written a brute force technique but for those who don't know Hold'em, its a 5 level for loop and for 4 people is in the ballpark of 44!/39! * 4 or about 521 million hand calculations. Its not exactly accessible in any reasonable time.

I really feel like you need to intelligently find the hands that will help you out, i.e. what are the odds that the person pulls a flush when the other guys don't, or something like that.

First off, I'm doing this in Java, I don't know much about actionscript in terms of threading, but one option I'm exploring is doing the process in a separate with a random sampling of cards instead of the for loop idea, this will avoid local maxima (i.e. if 3 suited cards are on the flop) and I can update the percentage display with a more up to date prediction while the players are betting.

Well, like I said, I'm implementing this now, so I'll check back on this thread when I'm done to see what type of comments people have posted.

rodericj
03-20-2007, 01:33 PM
Done. I think its best to get an estimation of the odds for the hands unless you know some other way. I'm wondering if on TV they render the odds AFTER the game has been played. Anyway, an estimation should be good enough for most cases I would think.